# Yahoo! UI Library

### TreeView Widget 2.5.0

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

Show Private Show Protected

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

This implementation takes either a string or object for the oData argument. If is it a string, we will use it for the display of this node (and it can contain any html code). If the parameter is an object, we look for a parameter called "html" that will be used for this node's display.

### Constructor

YAHOO.widget.HTMLNode `( oData , oParent , expanded , hasIcon )`

Parameters:
  `oData <object>` a string or object containing the data that will be used to render this node. Valid configuration properties:
  html
    The html content for the node
  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
  `hasIcon <boolean>` specifies whether or not leaf nodes should be rendered with or without a horizontal line line icon. If the icon is not displayed, the content fills the space it would have occupied. This option operates independently of the leaf node presentation logic for dynamic nodes.

### Properties

#### contentElId `- string`

The generated id that will contain the data passed in by the implementer.

#### contentStyle `- string`

The CSS class for the html content container. Defaults to ygtvhtml, but can be overridden to provide a custom presentation for a specific node.

#### html `- string`

The HTML content to use for this node's display

#### initContent `- object`

Sets up the node label

#### setHtml `- object`

Synchronizes the node.data, node.html, and the node's content

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

`_dynLoad, _type, children, childrenRendered, data, dataLoader, depth, dynamicLoadComplete, 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

#### getContentEl

`HTMLElement getContentEl ( )`
Returns the outer html element for this node's content

Returns: `HTMLElement`
  the element

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