refresh / reload a datagrid in flex

烈酒焚心 提交于 2019-12-11 16:06:46

问题


I am using a datagrid. It has itemEditor components, combo boxes, etc. as aprt of columns. Ideally datagrid.invalidateList() method works to reload the datagrid with new dataProvider data.

But, for me it is appending to the old data and new data gets added below the older data. I am not able to fix this reload of datagrid.


回答1:


Use ArrayCollection, not Array! ArrayCollection provides all the change notification machinery you need. Array does not.




回答2:


I'm having a little trouble understanding exactly what your problem is. Can't you just replace DataGrid.dataProvider with the new collection?




回答3:


Well I got that. I just had to make my array empty.

so now its likeif arr is an array acting as dataprovider.

arr=[];

This makes the array empty and then i make it as dataprovider.



来源:https://stackoverflow.com/questions/1112018/refresh-reload-a-datagrid-in-flex

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