Dear All,
Happy Thanksgiving.. After you finish your turkey, review this Flex example.. :-)
=======================
Today, we are going review DataGrid component. In fact, there is another component called 'AdvancedDataGrid' that can do more flexible data displaying, such as grouping, etc. However, AdvancedDataGrid requires license otherwise you will see some water market in your AdvancedDataGrid. We will cover this AdvancedDataGrid later.
DataGrid is used to display a set of records which is similar to the Excel spreadsheet format. Basically, you can sort, edit, or have another component included.
Let's take a look the sample code...
In the "Style" section, I've defined the stylesheet and tell Flex how I want the DataGrid to be displayed. All I want to have is set the font-weight and text align for the DataGrid header.
For the "XML" section, this is just the hard-coded section to simulate the data is retrieved back from database. However, in the real scenario, you can use HTTPService, WebService, or RemoteObject to retrieve the result set back from your server.
As you can see I use dataProvider="{nameList.name}" to bind the data into the DataGrid. The 'nameList' is the id of the XML. the 'name' is to tell the dataProvider where the data is started in the XML. For each column, you will need to specify the dataField which is mapping to the XML element.
I also define the last column 'Activated' as 'Checkbox' type. If the data contains 'true', the checkbox is checked; otherwise, unchecked.
It's easy, right?
Link to the source code.
http://mail.njccps.org/files/Sample2.mxml
Thanks,
Nelson
| Attachment | Size |
|---|---|
| Sample2.mxml | 2.29 KB |
| Sample2.swf | 314.39 KB |
