User Guide

DataSet.modelChanged 387
The event object (eventObj) contains the following properties:
target The DataSet object that generated the event.
type The string "iteratorScrolled".
firstItem The index (number) of the first item in the collection that was affected by
the change.
lastItem The index (number) of the last item in the collection that was affected by the
change (equals
firstItem if only one item was affected).
fieldName A string that contains the name of the field being affected. This property is
undefined unless the change was made to a property of the DataSet object.
eventName A string that describes the change that took place. This can be one of the
following values:
Example
In the following example, the modelChanged event gets dispatched whenever an item is
added or removed from the data set:
my_ds.addEventListener("modelChanged", onModelChanged);
function onModelChanged(evt_obj:Object):Void {
trace("[event =" + evt_obj.eventName + "] the data set now has " +
evt_obj.target.items.length + " items.");
}
my_ds.addItem({name:"Apples", price:14});
my_ds.addItem({name:"Bananas", price:8});
my_ds.removeItemAt(0);
String value Description
"addItems"
A series of items has been added.
"filterModel"
The model has been filtered, and the view needs refreshing (reset scroll
position).
"removeItems"
A series of items has been deleted.
"schemaLoaded"
The fields definition of the data provider has been declared.
"sort"
The data has been sorted.
"updateAll"
The entire view needs refreshing, excluding scroll position.
"updateColumn"
An entire field’s definition in the data provider needs refreshing.
"updateField"
A field in an item has been changed and needs refreshing.
"updateItems"
A series of items needs refreshing.