# Yahoo! UI Library

### TreeView Widget 2.2.2

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

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

Known Subclasses:
  YAHOO.widget.MenuNode

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.

### Constructor

YAHOO.widget.TextNode `( oData , oParent , expanded )`

Parameters:
  `oData <object>` a string or object containing the data that will be used to render this node
  `oParent <YAHOO.widget.Node>` this node's parent node
  `expanded <boolean>` the initial expanded/collapsed state

### Properties

#### 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.

#### Properties inherited from YAHOO.widget.Node:

`_dynLoad, _type, children, childrenRendered, data, dataLoader, depth, dynamicLoadComplete, expanded, hasIcon, href, iconMode, index, isLoading, multiExpand, nextSibling, nowrap, parent, previousSibling, renderHidden, target, tree`

#### Properties inherited from YAHOO.util.EventProvider:

`__yui_events, __yui_subscribers`

### Methods

#### getLabelEl

`object getLabelEl ( )`
Returns the label element

Returns: `object`
  the element

#### onLabelClick

`void onLabelClick ( me )`
Executed when the label is clicked. Fires the labelClick custom event.

Parameters:
  `me <Node>` this node

Returns: `void`
  false to cancel the anchor click

#### Methods inherited from YAHOO.widget.Node:

`appendChild, appendTo, applyParent, collapse toggle style., collapseAll, completeRender, expand, expandAll, getAncestor, getChildrenEl, getChildrenElId, getChildrenHtml, getDepthStyle, getEl, getElId, getHoverStyle, getHtml, getIconMode, getNodeHtml, getSiblings, getStyle, getToggleEl, getToggleElId, getToggleLink, hasChildren, hideChildren, init, insertAfter, insertBefore, isChildOf, isDynamic, isRoot, loadComplete, refresh, renderChildren, setDynamicLoad, showChildren, toggle, toString`

#### Methods inherited from YAHOO.util.EventProvider:

`createEvent, fireEvent, hasEvent, subscribe, unsubscribe, unsubscribeAll`

#### Events inherited from YAHOO.widget.Node:

`parentChange`

Copyright © 2007 Yahoo! Inc. All rights reserved.