YUI recommends YUI 3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

Yahoo! UI Library

TreeView Widget  2.5.0

Yahoo! UI Library > treeview > YAHOO.widget.TextNode

Show Private Show Protected

Class YAHOO.widget.TextNode - extends YAHOO.widget.Node

Known Subclasses:
The default node presentation. The first parameter should be either a string that will be used as the node's label, or an object that has a string propery called label. By default, the clicking the label will toggle the expanded/collapsed state of the node. By changing the href property of the instance, this behavior can be changed so that the label will go to the specified href.


YAHOO.widget.TextNode ( oData , oParent , expanded )
oData <object> a string or object containing the data that will be used to render this node. Valid properties:
The text for the node's label
The title attribute for the label anchor
The title attribute for the label anchor
The href for the node's label. By default it is set to expand/collapse the node.
The target attribute for the label anchor
A CSS class to apply to the label anchor
All other attributes are made available in noderef.data, which can be used to store custom attributes. TreeView.getNode(s)ByProperty can be used to retreive a node by one of the attributes.
oParent <YAHOO.widget.Node> this node's parent node
expanded <boolean> the initial expanded/collapsed state


label - string

The text for the label. It is assumed that the oData parameter will either be a string that will be used as the label, or an object that has a property called "label" that we will use.

labelElId - string

The derived element id of the label for this node

labelStyle - string

The CSS class for the label href. Defaults to ygtvlabel, but can be overridden to provide a custom presentation for a specific node.



object getLabelEl ( )
Returns the label element
Returns: object
the element


void onLabelClick ( me )
Executed when the label is clicked. Fires the labelClick custom event.
me <Node> this node
Returns: void
false to cancel the anchor click

Events inherited from YAHOO.widget.Node:

Copyright © 2007 Yahoo! Inc. All rights reserved.