MindFusion.Charting for JavaScript Programmer's Guide
ObservableCollection.collectionChanged Event
See Also
 






Occurs when an item is added, removed, changed, moved, or the entire list is refreshed.

Namespace: MindFusion.Common.Collections
File: ObservableCollection.js

 Syntax

JavaScript  Copy Code

EventDispatcher collectionChanged

 Event Data

The event handler method receives the following arguments:
sender
An ObservableCollection 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 code handles the collectionChanged event on the collection of items of a ListView object that is of type ObservableCollection:

JavaScript  Copy Code

var nodeList = new ui.ListView(document.getElementById("nodeList"));

nodeList.items.collectionChanged.addEventListener(itemsCollectionChangedEventHandler);


function itemsCollectionChangedEventHandler(sender, args)
{
 if(args.action == ui.NotifyCollectionChangedAction.Add)
 {
       //do something
 } 
}

 See Also

ObservableCollection Members
ObservableCollection Class
MindFusion.Common.Collections Namespace