Search code examples
apache-flexflex4advanceddatagridflex4.6

AdvancedDatagrid does not display grouped data


I am trying to display grouped data in AdvancedDatagrid but the data does not show up. When I specify the dataprovider without the grouping collection I am able to see the data. Is there something wrong with this code?

<mx:AdvancedDataGrid id="dgAssetStatus" width="100%" height="85%" initialize="gc.refresh();">
    <mx:dataProvider>
        <mx:GroupingCollection2 id="gc" source="{_list}">
            <mx:grouping>
                <mx:Grouping label="asset_name">
                    <mx:GroupingField name="asset_name"/>
                </mx:Grouping>                  
            </mx:grouping>
        </mx:GroupingCollection2>
    </mx:dataProvider>
    <mx:columns>
        <mx:AdvancedDataGridColumn dataField="asset_name" headerText="Asset"/> 
        <mx:AdvancedDataGridColumn dataField="status" headerText="Status"/>
    </mx:columns>
</mx:AdvancedDataGrid>

Solution

  • I figured out an answer to this question myself. I was not able to see any data in the ADG since the refresh() method was being called before the _list ArrayCollection was populated. I just had to move the refresh call to fix this issue.