Datagrid catching changes in dataprovider

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Datagrid catching changes in dataprovider

Derrick Grigg
I have a DataGrid that has it's DataProvider set to an ArrayCollection
that is defined in a ModelLocator (I'm using Cairngorm). The
ArrayCollection has defined ValueObjects in it. When I make a change
to any of the ValueObjects in the ArrayCollection, the DataGrid is
updated (via binding) and the changed values are displayed.

What I want to do is catch the data changing so that I can also update
some text around the DataGrid that notes the total number of items in
the DataGrid vs. the total number that meet a certain criteria.

Is there a way to listen for changes to the underlying data in a
DataGrid? I have tried the valueCommit and dataChange but they do not
seem to get fired when a change the ArrayCollection happens.






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|

Re: Datagrid catching changes in dataprovider

passive_thoughts
Could you listen for changes to the collection instead and then do
your comparisons when that event triggers?

model.ac.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE,
acChange);
....
private function acChange(event:CollectionEvent):void{
  lblCount.text = ac.length.toString();
}
 






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[hidden email]
    mailto:[hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/