4,328
社区成员
发帖
与我相关
我的任务
分享
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp()" layout="vertical" fontSize="12" backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var AC1:ArrayCollection;
private function initApp():void{
AC1=new ArrayCollection([{name:"开会",type:"紧急",steps:"0"},
{name:"结算",type:"一般",steps:"0"},
{name:"放假",type:"一般",steps:"0"}]);
}
protected function fun_AddImage(event:MouseEvent):void
{
trace(AC1);
for(var i:int=0; i<AC1.length; i++) {
trace(AC1[i].steps);
}
}
]]>
</mx:Script>
<mx:DataGrid rowCount="4" dataProvider="{AC1}" id="dg" >
<mx:columns>
<mx:DataGridColumn headerText="name" dataField="name"/>
<mx:DataGridColumn headerText="type" dataField="type"/>
<mx:DataGridColumn headerText="email">
<mx:itemRenderer>
<mx:Component>
<mx:TextInput text="{data.steps}"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
<mx:Button x="326" y="513" label="测试数据" click="fun_AddImage(event)"/>
</mx:Application>