Using grouped columns with hierarchical data : GroupingField « Grid « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Grid » GroupingFieldScreenshots 
Using grouped columns with hierarchical data
Using grouped columns with hierarchical data
 
<?xml version="1.0"?>
<!--
Code from Flex 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 
  (1proper attribution to Adobe is given as the owner of the user guide; and 
  (2any 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/

-->

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        
        import mx.collections.ArrayCollection;
        [Bindable]
        private var myHierarchicalData:ArrayCollection = new ArrayCollection([
            {Column1:"Southwest", Territory:"Arizona",Column2:"Barbara Jennings",Revenues:{Value1:38865, Value2:40000}},{Column1:"Southwest", Territory:"Arizona",Column2:"Dana Binn",Revenues:{Value1:29885, Value2:30000}},
            {Column1:"Southwest", Territory:"Central California",Column2:"Joe Smith",Revenues:{Value1:29134, Value2:30000}},{Column1:"Southwest", Territory:"Nevada",Column2:"Bethany Pittman",Revenues:{Value1:52888, Value2:45000}},
            {Column1:"Southwest", Territory:"Northern California",Column2:"Lauren Ipsum",Revenues:{Value1:38805, Value2:40000}},{Column1:"Southwest", Territory:"Northern California",Column2:"T.R. Smith",Revenues:{Value1:55498, Value2:40000}},
            {Column1:"Southwest", Territory:"Southern California",Column2:"Alice Treu",Revenues:{Value1:44985, Value2:45000}},
            {Column1:"Southwest", Territory:"Southern California",Column2:"Jane Grove",Revenues:{Value1:44913, Value2:45000}}
        ]);
      
    </mx:Script>
    <mx:AdvancedDataGrid width="100%" height="100%">
        <mx:dataProvider>
            <mx:HierarchicalData source="{myHierarchicalData}" />
        </mx:dataProvider>
        <mx:groupedColumns>
            <mx:AdvancedDataGridColumn dataField="Column1" />
            <mx:AdvancedDataGridColumn dataField="Column2"
                headerText="Territory Rep" />
            <mx:AdvancedDataGridColumnGroup
                headerText="Revenues">
                <mx:AdvancedDataGridColumn dataField="Value1" />
                <mx:AdvancedDataGridColumn dataField="Value2" />
            </mx:AdvancedDataGridColumnGroup>
        </mx:groupedColumns>
    </mx:AdvancedDataGrid>
</mx:Application>

   
  
Related examples in the same category
1.Using the default properties of the GroupingField and SummaryRow classesUsing the default properties of the GroupingField and SummaryRow classes
2.Nest column group for multiple column groupsNest column group for multiple column groups
3.Using grouped columns with hierarchical data column groups with hierarchical dataUsing grouped columns with hierarchical data column groups with hierarchical data
4.Summary Group AdvancedDataGridSummary Group AdvancedDataGrid
w__ww__.j___av___a__2__s___.c_o_m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.