开发者

Refreshing a binded DataGrid

开发者 https://www.devze.com 2023-02-19 19:11 出处:网络
I have a problem..I am binding an array collection to a datagrid in flex. My problem is whenever i try to remove an item from the array collection.. the datagrid does not refresh the values....This is

I have a problem..I am binding an array collection to a datagrid in flex. My problem is whenever i try to remove an item from the array collection.. the datagrid does not refresh the values....This is the code that I am using

coinCount = coinCount - showArray.getItemAt(eve开发者_JAVA技巧ntsList.selectedIndex).eventcost;
                pendingEventListArray.addItem(showArray.getItemAt(eventsList.selectedIndex));

showArray.removeItemAt(eventsList.selectedIndex);

showArray.refresh();

eventsList is the datagrid that is bounded to showArray(an Array Collection)


Two things:

  • Is your showArray declared as Bindable?
  • Refresh is used to refresh a filter on an ArrayCollection. Use showArray.dispatchEvent(new Event(PropertyChangeEvent.PROPERTY_CHANGE), or showArray.dispatchEvent(new Event(Event.CHANGE)...
0

精彩评论

暂无评论...
验证码 换一张
取 消