Search
Schedule.getItemById Method
See Also
 






Gets the item with the specified id.

Namespace: MindFusion.Scheduling
File: Schedule.js

 Syntax

JavaScript  Copy Code

function getItemById (id, [occurrenceIndex])

 Parameters

id

String. The id of the item.

occurrenceIndex
Optional.

Number. The occurrence index of the item.

 Return Value

Item. The item; null if no item with the specified id has been found.

 Example

The following code creates a new item for a birthday celebration that takes the whole present day. It provides the item with an id and then shows how to search for this item.

JavaScript  Copy Code

var p = MindFusion.Scheduling;

var date = p.DateTime.today();

// create a new item
var item = new p.Item();
item.subject = "Birthday Celebration";   
item.startTime = date;
item.endTime = p.DateTime.addDays(date.clone(),1);
item.allDayEvent = true;
item.location = getLocation(item.subject);
item.id = "birthday";
calendar.schedule.items.add(item);
………

var bItem = calendar.schedule.getItemById("birthday");

 See Also