Flex AdvancedDataGrid - ColumnOrder With Formatter and ItemRenderer Question For Experts

Posted by robin1126 on Stack Overflow See other posts from Stack Overflow or by robin1126
Published on 2010-03-25T22:12:11Z Indexed on 2010/03/25 22:13 UTC
Read the original article Hit count: 556

Filed under:
|
|

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

...

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(); 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); }

and then I save the columnArray to SharedObject.

I retrive them using the below code

for(var i:int=0;i 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. How can I reshuffle the columns but can preserve all the properties of it to the sharedobject and recover it again.

© Stack Overflow or respective owner

Related posts about advanceddatagrid

Related posts about column