Search
Schedule.itemsChanged Event
See Also
 






Raised when the items collection of the Schedule is changed.

Namespace: MindFusion.Scheduling
File: Schedule.js

 Syntax

JavaScript  Copy Code

EventDispatcher itemsChanged

 Event Data

The event handler method receives the following arguments:
sender
A Schedule instance, which is the source of the event. This object will be passed to the handler function as the first argument.
args
A NotifyCollectionChangedEventArgs instance, which contains event data. This object will be passed to the handler function as the second argument.

 Example

The following example attaches a handler to the itemsChanged event of a calendar schedule. In the handler method we get the last item from the items collection. Then we check if it starts after 19 o'clock.

JavaScript  Copy Code

var p = MindFusion.Scheduling;

// attach a handler - the collection of schedule items has changed.
calendar.schedule.itemsChanged.addEventListener(handleItemsChanged);

function handleItemsChanged(sender, args) {
        if(calendar.schedule.items.count () > 1)
        {
           var lastItem = schedule.items.items()[calendar.schedule.items.coun()-1];
           if(lastItem.startTime.hour > 19)
                  ...............
        }
     
}

 See Also