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...

Search Great Flex/Flash Sites