YUI Library Examples: TreeView Control: TreeView with Tooltips

TreeView Control: TreeView with Tooltips

In this example you see the default presentation for the TreeView Control. A single YAHOO.widget.Tooltip instance is used to provide tooltips for all nodes.

Adding Tooltips to the TreeView Control

This examples builds on our simple example. Tooltips are added to the nodes by utilizing the technique described in the Container Family example, One Tooltip, Many Context Elements.

The only additions beyond the stock tree required to get tooltips to work is:

  • Add a 'title' attribute to each TextNode. This attribute will be used for the node's tooltip.
  • Save the label element id of each node in an array that can be provided to the Tooltip constructor.

Copyright © 2007 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings