I have a datagrid that is editable. I was wondering if it's possible to retreive the cell value after user edits the single cell.
My datagrid will trigger griditemEditorSessionSave
event if users finish the editing, but I don't know how to get the new cell value.
//script
protected function dg_gridItemEditorSessionSaveHandler(event:GridItemEditorEvent):void
{
//I can only get the columnIndex but not the value
Alert.show (event.columnIndex);
}
//mxml
<s:DataGrid id="dg" editable="true" x="5" y="3" width="734" height="153"
gridItemEditorSessionSave="dg_gridItemEditorSessionSaveHandler(event)"
>
....
.....
</Datagrid>
Any thoughts? Thanks a lot.
Yes, this is possible..just recently i had this same problems.Im familiar thats theres not much As3 docs into this subject as such more or less on only innitializing the DataGrid and populating it, hence; Not grabbing the values its self.
On my Datagrid i found it was easier to save the whole dataGrid each time it was edited as i didnt find a way to do this for each individual cell.Just as a text file with comma's seperating the values
Using a loop function to go through each arrays length, Column / row, if you need complete source code for this project goto:
rowIndex
property of the event to get the index of the item in the dataProvider. And use thecolumnIndex
to deduce which property of the item was edited. Another idea is to checkevent.target
- not sure if that will be the renderer for the cell that was edited, or perhaps the dataGrid itself.. - Sunil D. 2012-04-05 00:38