Advanced Data Visualization components

AdvancedDataGrid Flex class

The AdvancedDataGrid is a new class available in Flex 3 as part of the data visualization package. You can experiment with the AdvancedDataGrid without owning the correct license, but you'll get a watermark above every grid.

The AdvancedDataGrid adds many features to the DataGrid. Actually, the AdvancedDataGrid is so different, it does not inherit from DataGrid, as you might expect. The DataGrid inheritance is DataGrid < DataGridBase < ListBase < ScrollControlBase. For the AdvancedDataGrid it goes AdvancedDataGrid < AdvancedDataGridBaseEx < AdvancedDataGridBase < AdvancedListBase < ScrollControlBase. Just as ListBase is the basis for the basic lists such as List, DataGrid, and TileList, AdvancedListBase serves as the base class for AdvancedDataGrid and OLAPDataGrid.

The AdvancedDataGrid exposes a property called hierarchicalCollectionView which is a HierarchicalCollectionView. This is typically identical to the dataProvider property (except in cases where you set the dataProvider to a HierarchicalCollectionView yourself). Internally, the AdvancedDataGrid accesses its dataProvider by casting its protected collection:ICollectionView property (from AdvancedListBase) to an IHierarchicalCollectionView.

If you want to filter the data, you need to apply your filter to this property. Filters applied to the source of the HierarchicalData will not work as expected. There is a Solution about Filtering HierarchicalCollectionViews that will help, as will reading the article on HierarchicalCollectionView.

More to come...

HierarchicalCollectionView Flex class

The HierarchicalCollectionView class is part of the advanced data visualization components that come with Flex Builder 3 Professional. It is used by the AdvancedDataGrid to represent a view of a hierarchical collection. This class includes functionality to construct a hierarchy; to open and close nodes; to apply filters and sorts; to iterate through the hierarchy; to monitor the data for changes; and to query the visible state of the data.

There is another class in the Flex SDK called HierarchicalCollectionView (in mx.controls.treeClasses) that is used internally by the Tree class. I will work out how to disambiguate the terms later. At the moment, I don't have an entry for that class.

I cannot publish the source code for this class because it is part of the proprietary data visualization components that Adobe sells as part of Flex Builder 3. I will be explaining some aspects of the internal behavior of the class, just without the accompanying source code.

This class is intimately tied to the AdvancedDataGrid. The HierarchicalCollectionView takes care of managing the hierarchy and communicates to the AdvancedDataGrid primary through event propagation. It is used to wrap the data in a HierarchicalData instance, in XML, or in a GroupingCollection.

As explained in the Solution Filter HierarchicalCollectionView parent and child branches, you can apply a filter function to the view and it will be applied to all of the items in the hierarchy from the top down. Sorts are similarly applied to all collections which comprise the hierarchy in a descending manner. If you have modeled your data using HierarchicalData, then it will sort parents and children separately. The GroupingCollection actually builds a similar hierarchy of ArrayCollections out of your flat data when you call refresh(), so it will behave in the same manner.

More to come...