Occurs just before an item is added, removed, changed, moved, or the entire list is refreshed.
Namespace: MindFusion.Common.Collections
File: ObservableCollection.js
SyntaxJavaScript
Copy Code
|
|---|
EventDispatcher collectionChanging |
Event DataThe 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 NotifyCollectionChangingEventArgs instance, which contains event data. This object will be passed to the handler function as the second argument.
RemarksThe cancel property of NotifyCollectionChangingEventArgs allows you to stop the action.
ExampleThe following code handles the collectionChanging event on the items collection of a ListView object that is of type ObservableCollection:
JavaScript
Copy Code
|
|---|
var nodeList = new ui.ListView(document.getElementById("nodeList")); nodeList.items.collectionChanging.addEventListener(itemsCollectionChangingEventHandler);
|
See Also