User Guide

324 DataProvider API
The Menu.modelChanged events event object has five additional properties:
eventName The eventName property is used to subcategorize modelChanged events.
Data-aware components use this information to avoid completely refreshing the
component instance (view) that is using the data provider. The
eventName property
supports the following values:
updateAll The entire view needs refreshing, excluding scroll position.
addItems A series of items has been added.
removeItems A series of items has been deleted.
updateItems A series of items needs refreshing.
sort The data has been sorted.
updateField A field in an item must be changed and needs refreshing.
updateColumn An entire fields definition in the data provider needs refreshing.
filterModel The model has been filtered, and the view needs refreshing (reset the
scroll position).
schemaLoaded The field’s definition of the data provider has been declared.
firstItem The index of the first affected item.
lastItem The index of the last affected item. The value equals firstItem if only one
item is affected.
removedIDs An array of the item identifiers that were removed.
fieldName A string indicating the name of the field that is affected.
For more information, see “EventDispatcher class” on page 499.
Example
In the following example, a handler called listener is defined and passed to
addEventListener() as the second parameter. The event object is captured by the
modelChanged handler in the evt parameter. When the modelChanged event is broadcast, a
trace statement is sent to the Output panel.
listener = new Object();
listener.modelChanged = function(evt){
trace(evt.eventName);
}
myList.addEventListener("modelChanged", listener);