views:

20

answers:

2

I have an editable grid and would like to update values based on the edited cell and i am doing this in the itemEditEndHandler such that when they finish editing a cell i update other cells that are dependent on it. the only problem is in the itemEditEndHandler the new value has not registered yet. If i try and get the value of the cell i find that its still giving me the old value and not the new value that i have entered.

A: 

If your datagrid is using a dataProvider that is an ArrayCollection, you can call its refresh() method in the handler triggered by the itemEditor's change event, then call the dataGrid's invalidateList() method.

Robusto
Thank you. I am also trying to access certain values in a cell by using ListCollectionView(dgViewPreview.dataProvider).getItemAt(rowIndex)[Datafield] but its not returning the right values is there any other way. i am using this in the itemeditendhandler.
Linda
+2  A: 

Listen for collectionChange event on the dataProvider of the DataGrid.

ListCollectionView objects, i.e. ArrayCollection and XMLListCollection objects, dispatch a CollectionEvent.COLLECTION_CHANGE event whenever there is a change in the collection. Check for the kind property of the dispatched event - if it is CollectionEventKind.UPDATE, it means that one or more items have been updated. The items array of the event will hold the updated items.

Amarghosh