Using hierarchical data providers

You use hierarchical data providers with the controls that display a nested hierarchy of nodes and subnodes, such as tree branches and leaves and Menu submenus and items. The following controls take hierarchical data providers:

The hierarchical components all use the same mechanism to work with the data provider. The examples in this section use the Tree control but also apply to the other components also.

Subtopics

About hierarchical data providers
Data descriptors and hierarchical data provider structure
Using an XML data provider
Using the XMLListCollection class

About hierarchical data providers

The Flex framework, by default, supports two types of hierarchical data sources:

XML can be any of the following: Strings containing well-formed XML; or XML, XMLList, or XMLListCollection objects, including objects generated by the <mx:XML> and <mx:XMLList> compile-time tags. (These tags support data binding, which you cannot do directly in ActionScript.) Flex can automatically structure a Tree or menu-based control to reflect the nesting hierarchy of well-formed XML.

Objects can be any set of nested Objects or Object subclasses (including Arrays or ArrayCollection objects) having a structure where the children of a node are in a children field. For more information, see Creating a custom data descriptor. You can also use the <mx:Model> compile-time tag to create nested objects that support data binding, but you must follow the structure defined in Using the <mx:Model> tag with Tree and menu-based controls.

You can add support for other hierarchical data provider structures, such as nested Objects where the children might be in fields with varying names.


Flex 2.01

Take a survey


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/201/html/about_dataproviders_057_13.html