2010-10-11 49 views

回答

0

如果你的datagrid使用的是一個ArrayCollection的dataProvider,你可以在由itemEditor的change事件觸發的handler中調用它的refresh()方法,然後調用dataGrid的invalidateList()方法。

+0

謝謝。我也試圖通過使用ListCollectionView(dgViewPreview.dataProvider).getItemAt(rowIndex)[Datafield]來訪問單元格中的某些值,但它沒有返回正確的值是否有任何其他方式。我在itemeditendhandler中使用了這個。 – Linda 2010-10-11 13:58:50

2

收聽DataGrid的dataProvider上的collectionChange事件。

ListCollectionView對象,即ArrayCollection中和的XMLListCollection對象,派遣CollectionEvent.COLLECTION_CHANGE事件每當有集合中的變化。檢查派發事件的kind屬性 - 如果它是CollectionEventKind.UPDATE,則表示一個或多個項目已更新。該事件的items數組將保存更新的項目。

0

使用gridItemEditorSessionSave

<s:DataGrid gridItemEditorSessionSave="dataGrid_gridItemEditorSessionSaveHandler(event)" > 
... 
... 
... 
</s:DataGrid> 

,並在動作

protected function dataGrid_gridItemEditorSessionSaveHandler(event:GridItemEditorEvent):void 
      { 
       Alert.show("Edited"); 
      } 
相關問題