I have a advanceddatagrid that has around 15 columns. Some are string,
some are numbers. I have shown 4 columns below.
The number columns have formatting done for zero precision and 2
digits precision. The itemRenderer is just to show Blue Color if the
number is +ve and Red Color if the number is -ve.
It looks something like below
<mx:columns>
<mx:AdvancedDataGridColumn dataField="Name" textAlign"left"/>
<mx:AdvancedDataGridColumn dataField="Time" textAlign="right"/
>
<mx:AdvancedDataGridColumn dataField="Score"
textAlign="right" formatter="{zeroPrecisionFormatter}"
sortable="true" itemRenderer="ColorRenderer" />
<mx:AdvancedDataGridColumn dataField="Average"
textAlign="right" headerWordWrap="true"
formatter="{twoPrecisionFormatter}" itemRenderer="ColorRenderer" />
...
<mx:columns>
I am trying to save the users setting of column order when he closes
the application and reload with the same order when the user opens the
applications. I am using SharedObjects and below is the code.
for(var i:int=0; i< adgrid.columns.length;i++){
var columnObject:Object = new Object(); //Create an
Object for each column to store the settings
columnObject.columnDataField =
adgrid.columns[i].dataField as String;
columnObject.columnHeader =
adgrid.columns[i].headerText as String;
columnObject.width = adgrid.columns[i].width;
columnArray.push(columnObject); //ColumnObject
Array
}
and then I save the columnArray to SharedObject.
I retrive them using the below code
for(var i:int=0;i<columnArray.length;i++){ //Loop and set properties
adgrid.columns[i].dataField =
columnArray[i].columnDataField;
adgrid.columns[i].headerText =
columnArray[i].columnHeader;
adgrid.columns[i].width = columnArray[i].width;
}
How can I save and reload the Formatter and ItemRenderer data .
I am having trouble saving the formatter and itemrenderer and
reloading it again
I would really appreciate if you can shown the code.
--
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en.