i have two questions
How to populate a flex datagrid from an Arraycollection without specifying DataGridColumn's individually. Is there any custom datagrid available where I can pass the datasource arraycollection and see the data populated in the output.
Without knowing the structure / bluprint of an object is there anyway to find how many member variable that class have?
With respect to your second question - there are 2 ways to accomplish this:
You can read more about these two techniques here .
static public function getDetails(argData:Object , grid:DataGrid):void {
// Get the Button control's E4X XML object description.
var classInfo:XML = describeType(argData);
// List accessors as properties.
var _columnList:Array = new Array();
for each (var a:XML in classInfo..accessor) {
// Do not get the property value if it is write only.
var _column:DataGridColumn = new DataGridColumn;
// Setting properties
_column.headerText = a.@name;
_column.dataField = a.@name;
_column.width = 180;
_columnList.push(_column);
}
grid.columns = _columnList;
}
Populated Datagrid through this routine , helps a lot debugging my result data.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.