Advanced DataGrid with Model Data : AdvancedDataGrid « Grid « Flex






Advanced DataGrid with Model Data

Advanced DataGrid with Model Data
       
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

  <mx:Model id="empModel">
    <employees>
        <row>
            <employeeid>1</employeeid>
            <firstname>A</firstname>
            <lastname>B</lastname>
            <department>Marketing</department>
        </row>
        <row>
            <employeeid>2</employeeid>
            <firstname>C</firstname>
            <lastname>D</lastname>
            <department>Shipping</department>
        </row>
    </employees>
  </mx:Model>  
  
  <mx:ArrayCollection id="employeeAC" source="{empModel.row}"/>
  <mx:AdvancedDataGrid id="employeeGrid" initialize="gc.refresh()">
    <mx:dataProvider>
      <mx:GroupingCollection2 id="gc" source="{employeeAC}">
        <mx:grouping>
          <mx:Grouping>
            <mx:GroupingField name="department"/>
          </mx:Grouping>
        </mx:grouping>
      </mx:GroupingCollection2>
    </mx:dataProvider>
    <mx:columns>
    <mx:AdvancedDataGridColumn dataField="department" headerText="Department" fontWeight="bold"/>
      <mx:AdvancedDataGridColumn dataField="firstname" headerText="First Name"/>
      <mx:AdvancedDataGridColumn dataField="lastname" headerText="Last Name"/>
    </mx:columns>
  </mx:AdvancedDataGrid>  
</mx: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.Advanecd DataGrid for NestedGroupsAdvanecd DataGrid for NestedGroups
26.Hierarchical Advanced DataGrid Column GroupingHierarchical Advanced DataGrid Column Grouping