In version 4 there is a Flex itemEditEnd (in Datagrid) event, but does not exist in 开发者_StackOverflow中文版Flex 4.5, itemEditEnd this event has been replaced by what event?
The MX DataGrid should not have changed; and according to the documentation, the itemEditEnd is still there.
However, Flex 4.5 introduced a DataGrid based on the Spark Architecture. This is a complete new component, and has many differences from the MX DataGrid.
You might look at the gridItemEditorSessionSave event as an alternate.
As per http://opensource.adobe.com/wiki/display/flexsdk/Data+Grid+Editing I tried to use:
override public function save():void
{
//data.dataField = value;
}
But I got error: "Incopatible override"
Any success at your side?
FIX,change void to Boolean, than in save() you can do pretty much the same stuff as in itemEditEnd in MX DataGrid:
override public function save():Boolean
{
data.dataField = value;
return true; //to save data to dataprovider
}
Example:
<s:GridItemEditor>
<s:TextInput id="valueDisplay" width="100%"/>
<fx:Script>
<![CDATA[
override public function get value():Object
{
return valueDisplay.text;
}
override public function set value(newValue:Object):void
{
valueDisplay.text = newValue.toString();
}
override public function save():Boolean
{
data.dataField = value;
return true;
}
]]>
</fx:Script>
</s:GridItemEditor>
精彩评论