In this simple example you see the default presentation for the TreeView Control. Click on labels or on the expand/collapse icons for each node to interact with the TreeView Control.
In this simple example for the TreeView Control, we begin with a target
<div> on the page; that target
<div> is where our tree will be built.
We can now instantiate our TreeView and populate its nodes.
Once you have a tree in place, and even before you call its
draw() method, you can begin subscribing to the events in its API. For example, if you'd like to execute a function each time a node is collapsed, you would do the following:
Use this simple example to get started in your explorations of the TreeView Control, then move on to the more complex examples that explore additional features the control offers.
Note: Logging and debugging is currently turned off for this example.
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.