Hi all,

I'm trying to detect changes in an ArrayCollection which is bound to a
DataGrid with some editable components. For some reason, however, the
event only seems to fire when the focus is change. For example, I
check a check-box, and nothing happens. When I then click somewhere
outside of the checkbox, the event is fired. Furthermore, If I check
the box twice before changing focus, nothing at all happens.

Is is possible that the event is only fired when the DataCollection is
refreshed, and that the refresh is not occurring until the focus changes?

Here is an example of what I'm doing ("colors" is the id for the
DataGrid associated with the colors ArrayC:

import mx.collections.ArrayCollection;
import mx.events.CollectionEvent;
import mx.controls.Alert;

[Bindable]
private var colors:ArrayCollection = new ArrayCollection([
    {color:"Red", display: true},
    {color:"Blue", display: true},
    {color:"Green", display: true}
]);
            
// Watch for changes to DataGrid CheckBox's
private function init():void {
    colors.addEventListener(
        CollectionEvent.COLLECTION_CHANGE, onChange
    );
}

public function onChange(evt:Event):void {
    Alert.show("Datagrid altered!");
}

Any ideas? Any advice would be greatly appreciated.


Thanks!
Keith


            

Reply via email to