DataSet.changesPending()

Availability

Flash Player 7.

Edition

Flash MX Professional 2004.

Usage

dataSetInstance.changesPending()

Returns

A Boolean value.

Description

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.

Example

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