This example demonstates how to use the ContextMenu widget to add a context menu to a YUI TreeView control. The context menu allows the user to add, edit and remove items from a TreeView instance.
Please Note: Opera users will need to do the following to use this example:
When adding context menus to large data structures like a
<table> or large list (
<ul>), it is recommended to bind a single
YAHOO.widget.ContextMenu instance to the structure's root element, than to a set
of its child nodes (
Doing so significantly improves the performance of a web page or
application by reducing the number of "contextmenu" event handlers
as well as the number of YAHOO.widget.ContextMenu instances in memory.
Begin by creating a TreeView instance.