Tuesday, February 7, 2012

Advanced Datagrid groupping tree bug

If you group an AdvancedDatagrid dataprovider with a grouping field, there is a mistake: If you have many rows, and scroll to right to the table, and than group a field, go back to scroll left, but there is an error (or you don't have error, but the tree lost some values). Obviously it is fail.

    <mx:AdvancedDataGrid width="100%" height="240"
            horizontalScrollPolicy="on" verticalScrollPolicy="on" >
        <mx:dataProvider>
            <mx:GroupingCollection2 id="gc" source="{arr_personal_production}" />
        </mx:dataProvider>
      
        <mx:columns>
            <mx:AdvancedDataGridColumn headerText="#" dataField="mppid"/>
            ...
        </mx:columns>
    </mx:AdvancedDataGrid>



The solution: After you add a groupping field to the grouppingCollection, the collection need a refresh, but not with the refresh() method.
You must call gc.refresh( false, true ); if you want to prevent the dispatchCollectionEvent.

No comments:

Post a Comment