Wednesday, February 24, 2010

Flex AdvancedDataGrid

Its been some time now that I am working on Flex's AdvancedDataGrid UI component and I feel I need to share some of the things that I have learned about it.

In this post I will only post the requirements of the UI that I was working on and about which I faced difficulty Googling the information.

All the following requirements could be addressed using the Flex's AdvancedDataGrid component.

Requirements-
1] Hierarchical data display - It is possible to display the data in a hierarchical tree structure having a parent child relation.
The following data structures could be used to represent the data in hierarchical fashion in AdvanceDataGrid.
  • HierarchicalData
  • XMLListCollection - xmlData
The data provider property of the advanced data grid will be as follows -
dataprovider = new HierarchicalData(xmlData)

2] Lazy loading of the data - It is possible to load the data on demand only when required.
e.g. All the 1st level parents could be loaded first and then when the user clicks on the expand button of a particular parent node only its immediate children can be dynamically fetched and loaded on demand.

The following event is fired when any parent node is expanded by user for on demand loading.
AdvancedDataGridEvent.ITEM_OPENING

3] Showing icons in rows instead of text data - It is possible to render icons instead of text in the row cells and this also applies to column header.

4] Change the icon shown next to expand button - It is possible to change the default icon which is shown next to the expand tree button.For this the following method of the AdvancedDataGrid component needs to be implemented

setIcons(item:Object):Class

I hope this info. was useful.In future posts I would share the source code of the application I have created which satisfy's all the above requirements.

No comments: