views:

164

answers:

2

please tell me what invalidateList(); function does?

i have one line of code, in which this function is getting called on arraycollection object

like

dg.invalidateList();

where dg is the id of datagrid, dataprovider for this dg is colors which is an arraycollection?? plzz tell me wht the invalidateList() function is doin? thanx

+1  A: 

Refer to this StackOverflow debate:

what is the difference between invalidateList and invalidateDisplayList?

Seems to me everything was explained there :) Ladislav

Ladislav
thanx man, i'll see it
Ankur Sharma
A: 

I would be willing to bet that whoever wrote that was trying to get the datagrid to refresh after the underlying arrayCollection was updated somehow. The better way of doing this is to dispatch a CollectionChange event on the arrayCollection after the update is made.

Example:

myArrayCollection.dispatchEvent( new CollectionEvent(CollectionEvent.COLLECTION_CHANGE) );
Ryan Guill