Refreshing a binded DataGrid
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)
, orshowArray.dispatchEvent(new Event(Event.CHANGE)
...
精彩评论