原来的flex程序需要修改,原先是DataGrid里有两个DataGridColumn,一个是名称,一个是值。dataprovider用于填值,现在需求有变化,需要某列的值变为下拉框,进行选择。代码如下:
1.视图区域:
<mx:DataGrid id="dgProp" width="100%" height="100%" editable="true" itemEditEnd="onGridEditEnd(event);">
<mx:columns>
<mx:DataGridColumn sortable="false" headerText="名称" width="80" dataField="name" editable="false"/>
<mx:DataGridColumn sortable="false" headerText="值" dataField="value" wordWrap="true"/>
</mx:columns>
<mx:dataProvider>
{properties}
</mx:dataProvider>
</mx:DataGrid>
2.代码区域:
private function setProperties(icon:FlowIcon): void{
properties.addItem({name: "名称", value: icon.name});
properties.addItem({name: "标签", value: icon.label});
properties.addItem({name: "业务名称", value: icon.memo});
properties.addItem({name: "命令字", value:icon.commandkey});
properties.addItem({name:"详情url",value:icon.urldetail});
properties.addItem({name:"编辑url",value:icon.editurl});}
需要实现的效果:
回答正确另有40分相送!!!