Actionscript 3 如何更改Flex ArrayCollection中项目的值
我有一个具有预定义值的ArrayCollection。我想为arrayCollection中的项指定一个新值。此新值在datagrid ItemEditEnd之后定义Actionscript 3 如何更改Flex ArrayCollection中项目的值,actionscript-3,apache-flex,Actionscript 3,Apache Flex,我有一个具有预定义值的ArrayCollection。我想为arrayCollection中的项指定一个新值。此新值在datagrid ItemEditEnd之后定义 private var tabRV :Array=[ {thevalue:"25",height:"115",col:"foo"}, {thevalue:"45",height:"115", col:"foo"}, {thevalue:
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_listedvcli[event.rowIndex][event.columnIndex],但它不起作用。实际上,在本例中,一个新属性正在创建[event.columnIndex value]
谢谢你的帮助很抱歉,我不确定你的问题是什么。这对我来说似乎很复杂。为什么不在ItemEditor中编辑数据(可能使用数据绑定)?这就是它的用途。我用itemrenderer编辑数据,但我需要更新dataprovider。