apache-flexadobegroupingadvanceddatagrid

Can't find my bug: Group flat data in Advanced Datagrid wont work


I've got an ArrayCollection which is properly displayed in this Advanced Datagrid:

 <mx:AdvancedDataGrid id="drawingDataDG"
 editable="true" sortableColumns="true"
 headerWordWrap="true"
 sortExpertMode="true"
 rowCount="8" y="10" right="10" left="10"
  dataProvider="{model.drawingsData}">   
    <mx:columns>
         <mx:AdvancedDataGridColumn 
      headerText="Approved in Week" 
      dataField="ApprovedInWeek" 
      editable="false"
      visible="true"  />
     <mx:AdvancedDataGridColumn 
      headerText="DRAWING_PK" 
      dataField="DRAWING_PK" 
      editable="false"
      visible="false"  />
     <mx:AdvancedDataGridColumn 
      headerText="Drawing No" 
      dataField="DRAWING_NO" 
      editable="false"
      visible="true"/>
     <mx:AdvancedDataGridColumn 
      headerText="Drawing Index" 
      dataField="DRAWING_INDEX" 
      editable="false"
      visible="true"/>
   </mx:columns>

`

According to this explanation link text I've implemented a GroupingCollection. But it just doesn't work!

<mx:AdvancedDataGrid id="drawingDataDG"
     editable="true" sortableColumns="true"
     headerWordWrap="true"
     sortExpertMode="true"
     rowCount="8" y="10" right="10" left="10"
            initialize="gc.refresh();">        
        <mx:dataProvider>
            <mx:GroupingCollection id="gc" source="{model.drawingsData}">
                    <mx:Grouping>
                        <mx:GroupingField name="ApprovedInWeek"/>
                    </mx:Grouping>
            </mx:GroupingCollection>
        </mx:dataProvider>  
        <mx:columns>
             <mx:AdvancedDataGridColumn 
          headerText="Approved in Week" 
          dataField="ApprovedInWeek" 
          editable="false"
          visible="true"  />
         <mx:AdvancedDataGridColumn 
          headerText="DRAWING_PK" 
          dataField="DRAWING_PK" 
          editable="false"
          visible="false"  />
         <mx:AdvancedDataGridColumn 
          headerText="Drawing No" 
          dataField="DRAWING_NO" 
          editable="false"
          visible="true"/>
         <mx:AdvancedDataGridColumn 
          headerText="Drawing Index" 
          dataField="DRAWING_INDEX" 
          editable="false"
          visible="true"/>
        </mx:columns>
 </mx:AdvancedDataGrid>

Please let me know what additional details you may need?


Solution

  • Finally I was able to implement grouping according to this blog: Summarizing Grouped Data With Flex 3 AdvancedDataGrid Thanks Robusto for guiding!