Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > DataSet component > DataSet.changesPending() | |||
Flash Player 7.
Flash MX Professional 2004.
dataSetInstance.changesPending()
A Boolean value.
Method; returns true if the collection, or any item in the collection, has changes pending that have not yet been sent in a delta packet; otherwise, returns false.
The following code enables a Save Changes button (not shown) if the DataSet collection, or any items with that collection, have had modifications made to them that haven't been committed to a delta packet.
my_ds.addItem({name:"Milton", years:3});
my_ds.addItem({name:"Mark", years:3});
my_ds.addItem({name:"Sarah", years:1});
my_ds.addItem({name:"Michael", years:2});
my_ds.addItem({name:"Frank", years:2});
my_ds.addEventListener("modelChanged", modelChangedListener);
function modelChangedListener(evt_obj:Object):Void {
if (evt_obj.target.changesPending()) {
trace("changes pending");
submitChanges_button.enabled = true;
}
}
submitChanges_button.enabled = false;
my_ds.addItem({name:"Hal", years:4});
Flash CS3