开发者

itemEditEnd for FLex 4.5

开发者 https://www.devze.com 2023-04-11 11:36 出处:网络
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 no

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消