Advanced DataGrid Demo
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
creationComplete="initData()">
<mx:Script>
import mx.collections.ArrayCollection;
[Bindable]
private var employeeAC:ArrayCollection = new ArrayCollection();
private function initData():void
{
employeeAC.source = [{department:"Shipping",
children: [
{firstname:"A", lastname:"B"},
{firstname:"C", lastname:"D"}]},
{department:"E",
children: [
{firstname:"F", lastname:"G"},
{firstname:"H", lastname:"I"}]}
];
}
</mx:Script>
<mx:AdvancedDataGrid id="employeeGrid">
<mx:dataProvider>
<mx:HierarchicalData source="{employeeAC}"/>
</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