refresh / reload a datagrid in flex

2019-08-25 07:43发布

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.

3条回答
看我几分像从前
2楼-- · 2019-08-25 08:14

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

查看更多
爷的心禁止访问
3楼-- · 2019-08-25 08:17

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.

查看更多
▲ chillily
4楼-- · 2019-08-25 08:26

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

查看更多
登录 后发表回答