invalidateList(); in flex3.0
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 invalidat开发者_运维百科eList() function is doin? thanx
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) );
Refer to this StackOverflow debate:
what is the difference between invalidateList and invalidateDisplayList?
Seems to me everything was explained there :) Ladislav
精彩评论