How to Filter All Nodes of a Flex Tree Component

The Flex Tree component allows .NET programmers to display a list of folders, files or other items in a tree-like structure. You most often use the tree component to navigate wiki content, manuals or documentation published on the Web. You filter out the nodes to stop viewers from clicking a link. For instance, if you do not have a section published, viewers see the link, but cannot click on it.

Instructions

    • 1

      Open the Flex development software on your computer and open the Web project to edit. Double-click the source code page for the tree control.

    • 2

      Add the library for the array that displays the components in the tree view. Copy and paste the following code to the top of your code section in the Flex form:

      import mx.collections.ArrayCollection;

    • 3

      Set the list of tree component nodes using the "ArrayCollection" library. Add the following code to your filter function:

      tree.children = new ArrayCollection(person.tree.source);

    • 4

      Filter all of the nodes in the tree. The following code sets the tree node filter to "true" to disable them:

      tree.children.filterFunction = true;

    • 5

      Refresh the tree view. After you change the filter options, you must refresh the tree for viewers to see the changes. Add the following code to complete the filter changes:

      tree.children.refresh();

Related Searches:

References

Comments

Related Ads

Featured