如何更改Flex ArrayCollection中项的值

时间:2012-05-30 20:56:00

标签: actionscript-3 flex

我有一个预定义值的ArrayCollection。我想为arrayCollection中的项目分配一个新值。此新值在datagrid ItemEditEnd。

之后定义
private var tabRV :Array=[
                {thevalue:"25",height:"115",col:"foo"},
                {thevalue:"45",height:"115", col:"foo"},
                {thevalue:"15",height:"115",col:"bb"},
                {thevalue:"95",height:"115", col:"aa"},
                ];

    [Bindable] 
    public var acRDV:ArrayCollection=new ArrayCollection(tabRV);

我的ItemEditEnd,看起来像这样:

private function getCellInfo(event:DataGridEvent):void {


            // Get the new value from the editor.
            var newVal:String = event.currentTarget.itemEditorInstance.htmlText;

            // Get the old value.
            var oldVal:String = 
                event.currentTarget.editedItemRenderer.data[event.dataField]; 
            DP_LISTEREDVCLI[event.rowIndex].thevalue=newVal;
            DP_LISTEREDVCLI[event.rowIndex].col=1;
            trace("xml new val "+DP_LISTEREDVCLI[event.rowIndex].[event.columnIndex]+"/"+DP_LISTEREDVCLI[event.rowIndex].[DP_LISTEREDVCLI.length]);


        } 

我希望创建一个泛型函数,DP_LISTEREDVCLI [event.rowIndex] [event.columnIndex],但它不起作用。实际上,在这种情况下,新属性正在创建[event.columnIndex value]

感谢您的帮助

0 个答案:

没有答案
相关问题