AdvancedDataGrid with Grouping(A tree table). : Tree Data « Components « Flex






AdvancedDataGrid with Grouping(A tree table).

AdvancedDataGrid with Grouping(A tree table).
      
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="600" height="300" >
<mx:Script>
    
        import mx.collections.ArrayCollection;
        [Bindable]
        private var grocerySalesData:ArrayCollection = new ArrayCollection([
            {Grocer:"A", Category:"Fruits", Item:"Apple", Q1:15000, Q2:10000},
            {Grocer:"B", Category:"Fruits",Item:"Pineapple", Q1:17000, Q2:15000},
            {Grocer:"C", Category:"Meats", Item:"Pork", Q1:43000, Q2:43000}
        ]);
  
</mx:Script>
    <mx:AdvancedDataGrid id="myAdvancedDG" width="100%" height="100%" defaultLeafIcon="{null}" initialize="gc.refresh();">
        <mx:dataProvider>
            <mx:GroupingCollection2 id="gc" source="{grocerySalesData}">
                <mx:Grouping>
                    <mx:GroupingField name="Grocer"/>
                    <mx:GroupingField name="Category"/>
                </mx:Grouping>
            </mx:GroupingCollection2>
        </mx:dataProvider>
        <mx:columns>
            <mx:AdvancedDataGridColumn dataField="GroupLabel" headerText="Grocer/Category"/>
            <mx:AdvancedDataGridColumn dataField="Item" headerText="Product(Item)"/>
            <mx:AdvancedDataGridColumn dataField="Q1"/>
            <mx:AdvancedDataGridColumn dataField="Q2"/>
        </mx:columns>
   </mx:AdvancedDataGrid>
</mx:Application>

   
    
    
    
    
    
  








Related examples in the same category

1.XML data for Tree viewXML data for Tree view
2.Reference XML attribute for tree dataReference XML attribute for tree data
3.Set dataProvider for Tree control through xml attributeSet dataProvider for Tree control through xml attribute
4.Using XML data models and use it as data for Tree controlUsing XML data models and use it as data for Tree control
5.Tree data is from XMLListCollectionTree data is from XMLListCollection
6.Use ActionScript to set up the data provider for Tree controlUse ActionScript to set up the data provider for Tree control
7.Fill XML data into Tree and get it back when selectedFill XML data into Tree and get it back when selected
8.Tree uses an XMLListCollection object as the data source:Tree uses an XMLListCollection object as the data source:
9.Tree with static dataTree with static data
10.Hierarchical AdvancedDataGrid Tree Column(TreeTable)Hierarchical AdvancedDataGrid Tree Column(TreeTable)
11.Use an XML object and Tree controlUse an XML object and Tree control
12.Tree control and XMLListCollectionTree control and XMLListCollection
13.Build Tree from XMLListCollection
14.Search Tree node is to search XML with XPathSearch Tree node is to search XML with XPath
15.Build a tree out of an XML documentBuild a tree out of an XML document
16.Tree controls uses an XML object directlyTree controls uses an XML object directly
17.Create Tree object from XMLListCreate Tree object from XMLList
18.Tree with static valueTree with static value