2 Replies Latest reply on Jul 30, 2008 12:48 PM by prancius

    AdvancedDataGrid provider refresh expand problem

    prancius
      Hello,

      I have a HttpService which periodically loading data to AdvancedDataGrid using Groups.

      <mx:AdvancedDataGrid disclosureClosedIcon="@Embed(source='images/datagrid/plus_used.gif')" disclosureOpenIcon="@Embed(source='images/datagrid/minus_used.gif')" sortExpertMode="false" id="moduleListPanel" width="100%" height="100%" itemClick="this.dataGridItemClick(event);" itemRollOver="showModuleTooltip(event);" itemRollOut="dataGridItemOut(event);" defaultLeafIcon="@Embed(source='images/datagrid/iconUncheckAll.gif')" folderOpenIcon="{null}" folderClosedIcon="{null}">
      <mx:dataProvider>
      <mx:GroupingCollection source="{photoFeed.module}" id="gc" childrenField="undefined">
      <mx:Grouping>
      <mx:GroupingField name="group"/>
      </mx:Grouping>
      </mx:GroupingCollection>
      </mx:dataProvider>
      <mx:columns>
      <mx:AdvancedDataGridColumn headerText="{resourceManager.getString(MY_BUNDLE, 'DATAGRIG_COLUMN_NAME')}" paddingLeft="30" width="150" dataField="image">
      <mx:itemRenderer>
      <mx:Component>
      <mx:HBox>
      <!--<mx:Image source="images/modules_icons/{data.image}"/>-->
      <mx:Panel backgroundColor="{data.color}" width="10" height="10" dropShadowEnabled="false" headerHeight="0"/>
      <mx:Label text="{data.moduleName}" color="{data.color}"/>
      </mx:HBox>

      </mx:Component>
      </mx:itemRenderer>
      </mx:AdvancedDataGridColumn>
      <mx:AdvancedDataGridColumn width="70" textAlign="right" headerText="{resourceManager.getString(MY_BUNDLE, 'DATAGRIG_COLUMN_SPEED')}" dataField="speed" color="{data.color}">
      <mx:itemRenderer>
      <mx:Component>
      <mx:HBox>
      <mx:Label text="{data.speed}" color="{data.color}"/>
      </mx:HBox>
      </mx:Component>
      </mx:itemRenderer>
      </mx:AdvancedDataGridColumn>

      The problem is when i perform gc.refresh(); all groups collapsed.

      I would like to update AdvancedDataGrid but groups should leave as it is.
      Now if user expand some group after refresh user should once again expand.

      Thank you a lot
      Pranas