如何使用动作脚本在动态数据网格中使用Flex中的动态列添加带有图像的itemrenderer?
示例代码:
arrDatagridCol = obj.Tables.Table1.Columns;
for each (var str:String in arrDatagridCol)
{
addDataGridColumn(str);
}
dgRoleToFunctionality.dataProvider = RoleManagementModel.instance().roleToFunctionality;
private function addDataGridColumn(dataField:String):void
{
var dgc:DataGridColumn = new DataGridColumn(dataField);
dgc.dataField = dataField dgc.headerText = dataField.replace("x0020"," ");
dgc.itemRenderer = new ClassFactory(com.rmsi.ManagementTool.RoleManagement.Maps.itemRendererDatagrid);
var cols:Array = dgRoleToFunctionality.columns; cols.push(dgc); dgRoleToFunctionality.columns = cols;
}