
...
</mx:XMLList>
<mx:DataGrid width="100%" height="100%" dataProvider=
"{employees}">
<mx:columns>
<mx:DataGridColumn dataField="name" headerText="Name"/>
<mx:DataGridColumn dataField="phone" headerText="Phone"/>
<mx:DataGridColumn dataField="email" headerText="Email"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
When I run this in Flex Builder I see Figure 4-11.
You don’t even have to define the columns in the DataGrid un-
less you want to. The DataGrid control is smart enough to de-
tect the columns from the data and set itself up if you haven’t
defined the columns.
The AdvancedDataGrid is just like the DataGrid but with a more
powerful set of features. For example, it has the ability to roll
up sections of the data and provide users with spinners so that
they can drill down into the data.
Example 4-12 shows AdvancedDataGrid in action.
Figure 4-11. A simple data grid
52 | Chapter 4: Flex Controls and Layout
Komentáře k této Příručce