Hi,
I'm trying to extend to the DataGrid class (call it DynamicDataGrid)
to make it work with dynamic column definition (# of columns and names
of columns will be fetched at runtime) so that I can use this datagrid
by giving it an array collection as dataprovider (this arraycollection
contains only data) and another array for column configuration.
Following is what I've done:
I extended DataGrid to contain one more variable "columnConfigs:Array"
(this array contains objects of type ColumnConfig which has headerText
and columnCode as its instance variables).
In the setter of columnConfigs, I set the headerText for each column
of the datagrid. but the DataGridColumn does not have columnCode
field, so I figured I need to extend DataGridColumn as well
(DynamicDataGridColumn). But i can't think of a good way to make
DynamicDataGrid to use an array of DynamicDataGridColumn for its
"columns" attribute without knowing much about the internal
implemenation of DataGrid.
Could anyone give me any suggestion? Or if you have a better way of
achieving I'm trying to do here, please help. Thanks.
Ban