Hierarchical Advanced DataGrid Column Grouping : AdvancedDataGrid « Grid « Flex






Hierarchical Advanced DataGrid Column Grouping

Hierarchical Advanced DataGrid Column Grouping
       

<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->



    <!-- dpcontrols/adg/SimpleHierarchicalADGGroupCol.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark">
    <fx:Script> 
         
        import mx.collections.ArrayCollection; 
        [Bindable] 
        private var dpHierarchy:ArrayCollection = new ArrayCollection([ 
        {Region:"Southwest", children: [ 
            {Region:"Arizona", children: [ 
                {Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000}, 
                {Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000}]}, 
                {Region:"Central California", children: [ 
                    {Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000}]}, 
                    {Region:"Nevada", children: [ 
                        {Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000}]}, 
                        {Region:"Northern California", children: [ 
                            {Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000}, 
                            {Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000}]}, 
                            {Region:"Southern California", children: [ 
                                {Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000}, 
                                {Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000}]} 
            ]} 
        ]);
      
    </fx:Script>
    <mx:AdvancedDataGrid width="100%" height="100%">
        <mx:dataProvider>
            <mx:HierarchicalData source="{dpHierarchy}" />
        </mx:dataProvider>
        <mx:groupedColumns>
            <mx:AdvancedDataGridColumn dataField="Region" />
            <mx:AdvancedDataGridColumn dataField="Territory_Rep" headerText="Territory Rep" />
            <mx:AdvancedDataGridColumnGroup headerText="Revenues">
                <mx:AdvancedDataGridColumn dataField="Actual" />
                <mx:AdvancedDataGridColumn dataField="Estimate" />
            </mx:AdvancedDataGridColumnGroup>
        </mx:groupedColumns>
    </mx:AdvancedDataGrid>
</s:Application>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Use HierarchicalData.childrenField to specify the name of the field that defines the hierarchyUse HierarchicalData.childrenField to specify the name of the field that defines the hierarchy
2.Hierarchical AdvancedDataGrid TreeColumnHierarchical AdvancedDataGrid TreeColumn
3.AdvancedDataGrid with four columnsAdvancedDataGrid with four columns
4.Using AdvancedDataGrid to show hierarchical dataUsing AdvancedDataGrid to show hierarchical data
5.Setting up the AdvancedDataGrid with dataField and headerTextSetting up the AdvancedDataGrid with dataField and headerText
6.AdvancedDataGrid and column groupingAdvancedDataGrid and column grouping
7.ArrayCollection and AdvancedDataGridArrayCollection and AdvancedDataGrid
8.Call invalidateList to refresh and apply the style to the AdvancedDataGridCall invalidateList to refresh and apply the style to the AdvancedDataGrid
9.Use styleFunction to apply style to AdvancedDataGrid based on conditionsUse styleFunction to apply style to AdvancedDataGrid based on conditions
10.Cut and paste cell for AdvancedDataGrid the TextArea control located at the bottom of the application:Cut and paste cell for AdvancedDataGrid the TextArea control located at the bottom of the application:
11.Allow Multiple Selection for AdvancedDataGridAllow Multiple Selection for AdvancedDataGrid
12.AdvancedDataGrid with With Hierarchical DataAdvancedDataGrid with With Hierarchical Data
13.AdvancedDataGrid with SummaryFieldAdvancedDataGrid with SummaryField
14.Fill data from XML to AdvancedDataGridFill data from XML to AdvancedDataGrid
15.Change column header for Hierarchical AdvancedDataGridChange column header for Hierarchical AdvancedDataGrid
16.Hierarchical AdvancedDataGrid CategoriesHierarchical AdvancedDataGrid Categories
17.Displaying hierarchical XML data and use it in AdvancedDataGridDisplaying hierarchical XML data and use it in AdvancedDataGrid
18.Group AdvancedDataGrid with MXML Default PropertiesGroup AdvancedDataGrid with MXML Default Properties
19.An AdvancedDataGrid that displays two summary fields, Min Actual and Max ActualAn AdvancedDataGrid that displays two summary fields, Min Actual and Max Actual
20.Summary Column with AdvancedDataGridSummary Column with AdvancedDataGrid
21.Summary AdvancedDataGrid with SummaryRow and SummaryField2Summary AdvancedDataGrid with SummaryRow and SummaryField2
22.implements the AdvancedDataGrid control shown in the previous figure:implements the AdvancedDataGrid control shown in the previous figure:
23.Regrouping AdvancedDataGridRegrouping AdvancedDataGrid
24.Advanced DataGrid DemoAdvanced DataGrid Demo
25.Advanced DataGrid with Model DataAdvanced DataGrid with Model Data
26.Advanecd DataGrid for NestedGroupsAdvanecd DataGrid for NestedGroups