# Yahoo! UI Library

### TreeView Widget 2.6.0

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

Show Private Show Protected Show Deprecated

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

A custom YAHOO.widget.Node that handles the unique nature of the virtual, presentationless root node.

### Constructor

YAHOO.widget.RootNode `( oTree )`

Parameters:
  `oTree <YAHOO.widget.TreeView>` The tree instance this node belongs to

### Properties

#### _type `- private string`

The node type
Default Value: "RootNode"

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

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

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

`__yui_events, __yui_subscribers`

### Methods

#### getNodeCount

`int getNodeCount ( )`
Count of nodes in tree. It overrides Nodes.getNodeCount because the root node should not be counted.

Returns: `int`
  number of nodes in the tree

#### getNodeDefinition

`Object | false getNodeDefinition ( )`
Returns an object which could be used to build a tree out of this node and its children. It can be passed to the tree constructor to reproduce this node as a tree. Since the RootNode is automatically created by treeView, its own definition is excluded from the returned node definition which only contains its children.

Returns: `Object | false`
  definition of the tree or false if any child node is defined as dynamic

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

`appendChild, appendTo, applyParent, collapse, collapseAll, completeRender, destroyEditorContents, editNode, expand, expandAll, fillEditorContainer, focus, getAncestor, getChildrenEl, getChildrenElId, getChildrenHtml, getContentEl, getContentHtml, getDepthStyle, getEl, getElId, getHoverStyle, getHtml, getIconMode, getNodeCount, getNodeDefinition, getNodeHtml, getSiblings, getStyle, getToggleEl, getToggleElId, getToggleLink, hasChildren, hideChildren, init, insertAfter, insertBefore, isChildOf, isDynamic, isRoot, loadComplete, refresh, renderChildren, saveEditorValue, setDynamicLoad, showChildren, toggle, toString`

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

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

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

`parentChange,`

Copyright © 2008 Yahoo! Inc. All rights reserved.