--------获取编辑前得值(第一种方法)。
dg.selectedItem.name
dg datagrid id
name datagrid dataField
------------获取编辑后的值
private function editHandler(event:DataGridEvent):void{
var obj:Object=DataGrid(event.target).editedItemPosition;
//var row:int=obj.rowIndex;
var dataField:String = event.dataField;
var col:int=obj.columnIndex;
var dataCol:DataGridColumn=cateGrid.columns[event.columnIndex] ;
//获取id
var itemIdp:int =cateGrid.selectedIndex;
if (event.columnIndex==1)
{
var newDatap:String =new String;
//获取编辑后的新值
newDatap =cateGrid.itemEditorInstance[dataCol.editorDataField];
}
if (event.columnIndex==2)
{
//编辑前的值(第二种方法)
newDatap=event.itemRenderer.data.OPCATEGORYNAME;
var opCodep:int;
//获取编辑后的新值
opCodep = cateGrid.itemEditorInstance[dataCol.editorDataField];
}
}