what is the difference between invalidateList and invalidateDisplayList?

对着背影说爱祢 提交于 2019-12-18 12:27:08

问题


I have a DataGrid, populated with objects in an ArrayCollection. After updating one of the objects' fields, I want the screen to update. The data source is not bindable, because I'm constructing it at runtime (and I don't understand how to make it bindable on the fly yet -- that's another question).

In this situation, if I call InvalidateDisplayList() on the grid nothing seems to happen. But if I call invalidateList(), the updates happen. (And it's very smooth too -- no flicker like I would expect from invalidating a window in WIN32.)

So the question: what is the difference between InvalidateList and InvalidateDisplayList? From the documentation it seems like either one should work.


回答1:


invalidateList tells the component that the data has changed, and it needs to reload it and re-render it.

invalidateDisplayList tells the component that it needs to redraw itself (but not necessarily reload its data).




回答2:


invalidateDisplayList() merely sets a flag so that updateDisplayList() can be called later during a screen update. invalidateList() is what you want.

http://livedocs.adobe.com/flex/2/langref/mx/core/UIComponent.html#invalidateDisplayList()



来源:https://stackoverflow.com/questions/74269/what-is-the-difference-between-invalidatelist-and-invalidatedisplaylist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!