webgui/www/extras/yui/docs/treeview/YAHOO.widget.Node.html
JT Smith 4f68a0933c added YUI and YUI-ext
fixed the resizable text area with IE problem
fixed the ad space with IE problem
merged the 7.2.0 and 7.1.4 change logs
2006-11-07 23:15:57 +00:00

2207 lines
53 KiB
HTML

<html>
<head>
<!--<title>YUI API - </title>-->
<!--<title>YUI API - YAHOO.widget.Node</title>-->
<title>API: TreeView YAHOO.widget.Node.html (YUI Library)</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
<h1>Yahoo! UI Library</h1>
<h3><a href="./index.html">TreeView</a></h3>
<div class="breadcrumbs">
<a href="./index.html">TreeView</a>
&gt;
<strong>YAHOO.widget.Node</strong>
</div>
</div>
<div id="body">
<div class="nav">
<div class="module resources">
<ul class="content">
<li><a href="overview-tree.html">Tree View</a></li>
<li><a href="index-all.html">Element Index</a></li>
</ul>
</div>
<div class="module">
<h4><a href="./allclasses-noframe.html">Classes</a></h4>
<ul class="content">
<li>
<a href="YAHOO.widget.html">
YAHOO.widget</a>
</li>
<li>
<a href="YAHOO.widget.HTMLNode.html">
YAHOO.widget.HTMLNode</a>
</li>
<li>
<a href="YAHOO.widget.MenuNode.html">
YAHOO.widget.MenuNode</a>
</li>
<li>
<a href="YAHOO.widget.Node.html">
YAHOO.widget.Node</a>
</li>
<li>
<a href="YAHOO.widget.RootNode.html">
YAHOO.widget.RootNode</a>
</li>
<li>
<a href="YAHOO.widget.TextNode.html">
YAHOO.widget.TextNode</a>
</li>
<li>
<a href="YAHOO.widget.TreeView.html">
YAHOO.widget.TreeView</a>
</li>
<li>
<a href="YAHOO.widget.TVAnim.html">
YAHOO.widget.TVAnim</a>
</li>
<li>
<a href="YAHOO.widget.TVFadeIn.html">
YAHOO.widget.TVFadeIn</a>
</li>
<li>
<a href="YAHOO.widget.TVFadeOut.html">
YAHOO.widget.TVFadeOut</a>
</li>
</ul>
</div>
<div class="module">
<h4><a href="./overview-summary.html">Files</a></h4>
<ul class="content">
<li>
<a href="overview-summary-HTMLNode.js.html">
HTMLNode.js</a>
</li>
<li>
<a href="overview-summary-MenuNode.js.html">
MenuNode.js</a>
</li>
<li>
<a href="overview-summary-Node.js.html">
Node.js</a>
</li>
<li>
<a href="overview-summary-RootNode.js.html">
RootNode.js</a>
</li>
<li>
<a href="overview-summary-TextNode.js.html">
TextNode.js</a>
</li>
<li>
<a href="overview-summary-TreeView.js.html">
TreeView.js</a>
</li>
<li>
<a href="overview-summary-TVAnim.js.html">
TVAnim.js</a>
</li>
<li>
<a href="overview-summary-TVFadeIn.js.html">
TVFadeIn.js</a>
</li>
<li>
<a href="overview-summary-TVFadeOut.js.html">
TVFadeOut.js</a>
</li>
</ul>
</div>
</div>
<div id="pri">
<div class="main">
<h2>Class YAHOO.widget.Node</h2>
<pre>Object
|
+--<b>YAHOO.widget.Node</b>
</pre>
<dl class="subclasses">
<dt>Direct Known Subclasses:</dd>
<dd>
<a href="YAHOO.widget.TextNode.html">YAHOO.widget.TextNode</a>, <a href="YAHOO.widget.HTMLNode.html">YAHOO.widget.HTMLNode</a>, <a href="YAHOO.widget.RootNode.html">YAHOO.widget.RootNode</a>
</dd>
</dl>
<hr />
<!-- Class definition -->
<div class="class-def">
<div class="class-name">
<span class="class-attribs">
</span>
<span class="class-type">class</span>
<b>YAHOO.widget.Node</b>
</div>
<div class="class-extends">
</div>
</div>
<div class="meta">
</div>
<!-- ======== QUICK LINKS ======== -->
<div class="quick-links">
<strong>Quick Links:</strong>&nbsp;
<a href="#field_summary">Field Summary</a>
|
<a href="#constructor_summary">Constructor Summary</a>
|
<a href="#methodSummary">Method Summary</a> |
<a href="#methodDetails">Method Details</a>
</div>
<!-- ======== END QUICK LINKS ======== -->
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- ======== END NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<div class="section field summaries">
<h3><a name="field_summary">Field Summary</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<td class="flags">Node[]</td>
<td class="spec">
<code>
<a href="#children">children</a>
</code>
<div class="description">
This node's child node collection.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#childrenRendered">childrenRendered</a>
</code>
<div class="description">
This flag is set to true when the html is generated for this node's
children, and set to false when new children are added.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">object</td>
<td class="spec">
<code>
<a href="#data">data</a>
</code>
<div class="description">
The data linked to this node.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">function</td>
<td class="spec">
<code>
<a href="#dataLoader">dataLoader</a>
</code>
<div class="description">
Function to execute when we need to get this node's child data.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#dynamicLoadComplete">dynamicLoadComplete</a>
</code>
<div class="description">
Dynamically loaded nodes only fetch the data the first time they are
expanded.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#expanded">expanded</a>
</code>
<div class="description">
The node's expanded/collapsed state&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#hasIcon">hasIcon</a>
</code>
<div class="description">
The toggle/branch icon will not show if this is set to false.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">string</td>
<td class="spec">
<code>
<a href="#href">href</a>
</code>
<div class="description">
The href for the node's label.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">int</td>
<td class="spec">
<code>
<a href="#iconMode">iconMode</a>
</code>
<div class="description">
Used to configure what happens when a dynamic load node is expanded
and we discover that it does not have children.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">int</td>
<td class="spec">
<code>
<a href="#index">index</a>
</code>
<div class="description">
The index for this instance obtained from global counter in YAHOO.widget.TreeView.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#isLoading">isLoading</a>
</code>
<div class="description">
This is true for dynamically loading nodes while waiting for the
callback to return.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#multiExpand">multiExpand</a>
</code>
<div class="description">
Can multiple children be expanded at once?&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Node</td>
<td class="spec">
<code>
<a href="#nextSibling">nextSibling</a>
</code>
<div class="description">
This node's next sibling&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Node</td>
<td class="spec">
<code>
<a href="#parent">parent</a>
</code>
<div class="description">
Parent node&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Node</td>
<td class="spec">
<code>
<a href="#previousSibling">previousSibling</a>
</code>
<div class="description">
This node's previous sibling&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#renderHidden">renderHidden</a>
</code>
<div class="description">
Should we render children for a collapsed node?&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">string</td>
<td class="spec">
<code>
<a href="#target">target</a>
</code>
<div class="description">
The label href target, defaults to current window&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">TreeView</td>
<td class="spec">
<code>
<a href="#tree">tree</a>
</code>
<div class="description">
Tree instance this node is part of&nbsp;
</div>
</td>
</tr>
</table>
</div>
</div>
<!-- =========== END FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<div class="section contructor summaries">
<h3><a name="constructor_summary">Constructor Summary</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<code class="spec">
<a href="YAHOO.widget.Node.html#YAHOO.widget.Node()">YAHOO.widget.Node</a>
</code>
<div class="description">
The base class for all tree nodes.&nbsp;
</div>
</div>
</div>
<!-- ======== END CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<div class="section method summaries">
<h3><a name="methodSummary">Method Summary</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<td class="flags">Node</td>
<td class="spec">
<code>
<a href="#appendTo">appendTo</a>
(parentNode)
</code>
<div class="description">
Appends this node to the supplied node's child collection&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#applyParent">applyParent</a>
(&lt;Node&gt; parentNode)
</code>
<div class="description">
Certain properties for the node cannot be set until the parent
is known.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#collapse">collapse</a>
()
</code>
<div class="description">
Hides this nodes children (creating them if necessary), changes the
toggle style.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#collapseAll">collapseAll</a>
()
</code>
<div class="description">
Recursively collapses all of this node's children.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">string</td>
<td class="spec">
<code>
<a href="#completeRender">completeRender</a>
()
</code>
<div class="description">
Called when we know we have all the child data.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#expand">expand</a>
()
</code>
<div class="description">
Shows this nodes children (creating them if necessary), changes the
toggle style, and collapses its siblings if multiExpand is not set.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#expandAll">expandAll</a>
()
</code>
<div class="description">
Recursively expands all of this node's children.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Node</td>
<td class="spec">
<code>
<a href="#getAncestor">getAncestor</a>
(&lt;int&gt; depth)
</code>
<div class="description">
Returns this node's ancestor at the specified depth.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">HTMLElement</td>
<td class="spec">
<code>
<a href="#getChildrenEl">getChildrenEl</a>
()
</code>
<div class="description">
Returns the div that was generated for this node's children&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">string</td>
<td class="spec">
<code>
<a href="#getChildrenElId">getChildrenElId</a>
()
</code>
<div class="description">
Returns the id for this node's children div&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">string</td>
<td class="spec">
<code>
<a href="#getDepthStyle">getDepthStyle</a>
(&lt;int&gt; depth)
</code>
<div class="description">
Returns the css class for the spacer at the specified depth for
this node.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">HTMLElement</td>
<td class="spec">
<code>
<a href="#getEl">getEl</a>
()
</code>
<div class="description">
Returns this node's container html element&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">string</td>
<td class="spec">
<code>
<a href="#getElId">getElId</a>
()
</code>
<div class="description">
Returns the id for this node's container div&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">string</td>
<td class="spec">
<code>
<a href="#getHoverStyle">getHoverStyle</a>
()
</code>
<div class="description">
Returns the hover style for the icon&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">string</td>
<td class="spec">
<code>
<a href="#getHtml">getHtml</a>
()
</code>
<div class="description">
Returns the markup for this node and its children.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#getIconMode">getIconMode</a>
()
</code>
<div class="description">
&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#getNodeHtml">getNodeHtml</a>
()
</code>
<div class="description">
Get the markup for the node.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#getSiblings">getSiblings</a>
()
</code>
<div class="description">
Returns a node array of this node's siblings, null if none.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">string</td>
<td class="spec">
<code>
<a href="#getStyle">getStyle</a>
()
</code>
<div class="description">
Returns the css style name for the toggle&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">HTMLElement</td>
<td class="spec">
<code>
<a href="#getToggleEl">getToggleEl</a>
()
</code>
<div class="description">
Returns the element that is being used for this node's toggle.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">string</td>
<td class="spec">
<code>
<a href="#getToggleElId">getToggleElId</a>
()
</code>
<div class="description">
Returns the id for this node's toggle element&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">string</td>
<td class="spec">
<code>
<a href="#getToggleLink">getToggleLink</a>
()
</code>
<div class="description">
Generates the link that will invoke this node's toggle method&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#hasChildren">hasChildren</a>
(checkForLazyLoad)
</code>
<div class="description">
Checks if this node has children.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#hideChildren">hideChildren</a>
()
</code>
<div class="description">
Hides this node's children&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#init">init</a>
(oData, oParent, expanded)
</code>
<div class="description">
Initializes this node, gets some of the properties from the parent&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Node</td>
<td class="spec">
<code>
<a href="#insertAfter">insertAfter</a>
(node)
</code>
<div class="description">
Inserts this node after the supplied node&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Node</td>
<td class="spec">
<code>
<a href="#insertBefore">insertBefore</a>
(node)
</code>
<div class="description">
Inserts this node before this supplied node&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#isDynamic">isDynamic</a>
()
</code>
<div class="description">
Evaluates if this node's children should be loaded dynamically.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">boolean</td>
<td class="spec">
<code>
<a href="#isRoot">isRoot</a>
()
</code>
<div class="description">
Evaluates if this node is the root node of the tree&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#loadComplete">loadComplete</a>
()
</code>
<div class="description">
Load complete is the callback function we pass to the data provider
in dynamic load situations.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#refresh">refresh</a>
()
</code>
<div class="description">
Regenerates the html for this node and its children.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#setDynamicLoad">setDynamicLoad</a>
(fnDataLoader, iconMode)
</code>
<div class="description">
Configures this node for dynamically obtaining the child data
when the node is first expanded.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#showChildren">showChildren</a>
()
</code>
<div class="description">
Shows this node's children&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">void</td>
<td class="spec">
<code>
<a href="#toggle">toggle</a>
()
</code>
<div class="description">
Expands if node is collapsed, collapses otherwise.&nbsp;
</div>
</td>
</tr>
<tr>
<td class="flags">Object</td>
<td class="spec">
<code>
<a href="#toString">toString</a>
()
</code>
<div class="description">
toString&nbsp;
</div>
</td>
</tr>
</table>
</div>
</div>
<!-- ========== END METHOD SUMMARY =========== -->
<!-- ============ FIELD DETAIL START =========== -->
<div class="section field details">
<h3><a name="field_detail">Field Detail</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<h4><a name="children">children</a></h4>
<div class="detail">
<code>
Node[]
&nbsp;
<strong>children</strong>
</code>
<div class="description">
This node's child node collection.
</div>
</div>
<hr />
<h4><a name="childrenRendered">childrenRendered</a></h4>
<div class="detail">
<code>
boolean
&nbsp;
<strong>childrenRendered</strong>
</code>
<div class="description">
This flag is set to true when the html is generated for this node's
children, and set to false when new children are added.
</div>
</div>
<hr />
<h4><a name="data">data</a></h4>
<div class="detail">
<code>
object
&nbsp;
<strong>data</strong>
</code>
<div class="description">
The data linked to this node. This can be any object or primitive
value, and the data can be used in getNodeHtml().
</div>
</div>
<hr />
<h4><a name="dataLoader">dataLoader</a></h4>
<div class="detail">
<code>
function
&nbsp;
<strong>dataLoader</strong>
</code>
<div class="description">
Function to execute when we need to get this node's child data.
</div>
</div>
<hr />
<h4><a name="dynamicLoadComplete">dynamicLoadComplete</a></h4>
<div class="detail">
<code>
boolean
&nbsp;
<strong>dynamicLoadComplete</strong>
</code>
<div class="description">
Dynamically loaded nodes only fetch the data the first time they are
expanded. This flag is set to true once the data has been fetched.
</div>
</div>
<hr />
<h4><a name="expanded">expanded</a></h4>
<div class="detail">
<code>
boolean
&nbsp;
<strong>expanded</strong>
</code>
<div class="description">
The node's expanded/collapsed state
</div>
</div>
<hr />
<h4><a name="hasIcon">hasIcon</a></h4>
<div class="detail">
<code>
boolean
&nbsp;
<strong>hasIcon</strong>
</code>
<div class="description">
The toggle/branch icon will not show if this is set to false. This
could be useful if the implementer wants to have the child contain
extra info about the parent, rather than an actual node.
</div>
</div>
<hr />
<h4><a name="href">href</a></h4>
<div class="detail">
<code>
string
&nbsp;
<strong>href</strong>
</code>
<div class="description">
The href for the node's label. If one is not specified, the href will
be set so that it toggles the node.
</div>
</div>
<hr />
<h4><a name="iconMode">iconMode</a></h4>
<div class="detail">
<code>
int
&nbsp;
<strong>iconMode</strong>
</code>
<div class="description">
Used to configure what happens when a dynamic load node is expanded
and we discover that it does not have children. By default, it is
treated as if it still could have children (plus/minus icon). Set
iconMode to have it display like a leaf node instead.
</div>
</div>
<hr />
<h4><a name="index">index</a></h4>
<div class="detail">
<code>
int
&nbsp;
<strong>index</strong>
</code>
<div class="description">
The index for this instance obtained from global counter in YAHOO.widget.TreeView.
</div>
</div>
<hr />
<h4><a name="isLoading">isLoading</a></h4>
<div class="detail">
<code>
boolean
&nbsp;
<strong>isLoading</strong>
</code>
<div class="description">
This is true for dynamically loading nodes while waiting for the
callback to return.
</div>
</div>
<hr />
<h4><a name="multiExpand">multiExpand</a></h4>
<div class="detail">
<code>
boolean
&nbsp;
<strong>multiExpand</strong>
</code>
<div class="description">
Can multiple children be expanded at once?
</div>
</div>
<hr />
<h4><a name="nextSibling">nextSibling</a></h4>
<div class="detail">
<code>
Node
&nbsp;
<strong>nextSibling</strong>
</code>
<div class="description">
This node's next sibling
</div>
</div>
<hr />
<h4><a name="parent">parent</a></h4>
<div class="detail">
<code>
Node
&nbsp;
<strong>parent</strong>
</code>
<div class="description">
Parent node
</div>
</div>
<hr />
<h4><a name="previousSibling">previousSibling</a></h4>
<div class="detail">
<code>
Node
&nbsp;
<strong>previousSibling</strong>
</code>
<div class="description">
This node's previous sibling
</div>
</div>
<hr />
<h4><a name="renderHidden">renderHidden</a></h4>
<div class="detail">
<code>
boolean
&nbsp;
<strong>renderHidden</strong>
</code>
<div class="description">
Should we render children for a collapsed node? It is possible that the
implementer will want to render the hidden data...
</div>
</div>
<hr />
<h4><a name="target">target</a></h4>
<div class="detail">
<code>
string
&nbsp;
<strong>target</strong>
</code>
<div class="description">
The label href target, defaults to current window
</div>
</div>
<hr />
<h4><a name="tree">tree</a></h4>
<div class="detail">
<code>
TreeView
&nbsp;
<strong>tree</strong>
</code>
<div class="description">
Tree instance this node is part of
</div>
</div>
<hr />
</div>
</div>
<!-- ============ FIELD DETAIL END =========== -->
<!-- ========= CONSTRUCTOR DETAIL START ======== -->
<div class="section constructor details">
<h3><a name="constructor_detail">Constructor Detail</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<h4><a name="YAHOO.widget.Node()">YAHOO.widget.Node</a></h4>
<div class="detail">
<code>
<strong>YAHOO.widget.Node</strong>
()
</code>
<div class="description">
The base class for all tree nodes. The node's presentation and behavior in
response to mouse events is handled in Node subclasses.
<dl>
<dt>Parameters:</dt>
<dd>
<code>oData</code> -
{object} a string or object containing the data that will be used to render this node
</dd>
<dd>
<code>oParent</code> -
{Node} this node's parent node
</dd>
<dd>
<code>expanded</code> -
{boolean} the initial expanded/collapsed state
</dd>
</dl>
</div>
</div>
</div>
</div>
<!-- ========= CONSTRUCTOR DETAIL END ======== -->
<!-- ============ METHOD DETAIL START ========== -->
<div class="section method details">
<h3><a name="methodDetails">Method Detail</a> <span class="top">[<a href="#top">top</a>]</span></h3>
<div class="content">
<h4><a name="appendTo">appendTo</a></h4>
<div class="detail">
<code>
Node
<strong>appendTo</strong>
(parentNode)
</code>
<div class="description">
Appends this node to the supplied node's child collection
<dl>
<dt>Parameters:</dt>
<dd>
<code>parentNode</code> -
{Node} the node to append to.
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> The appended node</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="applyParent">applyParent</a></h4>
<div class="detail">
<code>
boolean
<strong>applyParent</strong>
(&lt;Node&gt; parentNode)
</code>
<div class="description">
Certain properties for the node cannot be set until the parent
is known. This is called after the node is inserted into a tree.
the parent is also applied to this node's children in order to
make it possible to move a branch from one tree to another.
<dl>
<dt>Parameters:</dt>
<dd>
<code>parentNode</code> -
this node's parent node
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> true if the application was successful</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="collapse">collapse</a></h4>
<div class="detail">
<code>
void
<strong>collapse</strong>
()
</code>
<div class="description">
Hides this nodes children (creating them if necessary), changes the
toggle style.
</div>
</div>
<hr />
<h4><a name="collapseAll">collapseAll</a></h4>
<div class="detail">
<code>
void
<strong>collapseAll</strong>
()
</code>
<div class="description">
Recursively collapses all of this node's children.
</div>
</div>
<hr />
<h4><a name="completeRender">completeRender</a></h4>
<div class="detail">
<code>
string
<strong>completeRender</strong>
()
</code>
<div class="description">
Called when we know we have all the child data.
<dl>
<dt>Returns:</dt>
<dd> children html</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="expand">expand</a></h4>
<div class="detail">
<code>
void
<strong>expand</strong>
()
</code>
<div class="description">
Shows this nodes children (creating them if necessary), changes the
toggle style, and collapses its siblings if multiExpand is not set.
</div>
</div>
<hr />
<h4><a name="expandAll">expandAll</a></h4>
<div class="detail">
<code>
void
<strong>expandAll</strong>
()
</code>
<div class="description">
Recursively expands all of this node's children.
</div>
</div>
<hr />
<h4><a name="getAncestor">getAncestor</a></h4>
<div class="detail">
<code>
Node
<strong>getAncestor</strong>
(&lt;int&gt; depth)
</code>
<div class="description">
Returns this node's ancestor at the specified depth.
<dl>
<dt>Parameters:</dt>
<dd>
<code>depth</code> -
the depth of the ancestor.
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> the ancestor</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getChildrenEl">getChildrenEl</a></h4>
<div class="detail">
<code>
HTMLElement
<strong>getChildrenEl</strong>
()
</code>
<div class="description">
Returns the div that was generated for this node's children
<dl>
<dt>Returns:</dt>
<dd> this node's children div</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getChildrenElId">getChildrenElId</a></h4>
<div class="detail">
<code>
string
<strong>getChildrenElId</strong>
()
</code>
<div class="description">
Returns the id for this node's children div
<dl>
<dt>Returns:</dt>
<dd> the element id for this node's children div</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getDepthStyle">getDepthStyle</a></h4>
<div class="detail">
<code>
string
<strong>getDepthStyle</strong>
(&lt;int&gt; depth)
</code>
<div class="description">
Returns the css class for the spacer at the specified depth for
this node. If this node's ancestor at the specified depth
has a next sibling the presentation is different than if it
does not have a next sibling
<dl>
<dt>Parameters:</dt>
<dd>
<code>depth</code> -
the depth of the ancestor.
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> the css class for the spacer</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getEl">getEl</a></h4>
<div class="detail">
<code>
HTMLElement
<strong>getEl</strong>
()
</code>
<div class="description">
Returns this node's container html element
<dl>
<dt>Returns:</dt>
<dd> the container html element</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getElId">getElId</a></h4>
<div class="detail">
<code>
string
<strong>getElId</strong>
()
</code>
<div class="description">
Returns the id for this node's container div
<dl>
<dt>Returns:</dt>
<dd> the element id</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getHoverStyle">getHoverStyle</a></h4>
<div class="detail">
<code>
string
<strong>getHoverStyle</strong>
()
</code>
<div class="description">
Returns the hover style for the icon
<dl>
<dt>Returns:</dt>
<dd> the css class hover state</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getHtml">getHtml</a></h4>
<div class="detail">
<code>
string
<strong>getHtml</strong>
()
</code>
<div class="description">
Returns the markup for this node and its children.
<dl>
<dt>Returns:</dt>
<dd> the markup for this node and its expanded children.</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getIconMode">getIconMode</a></h4>
<div class="detail">
<code>
Object
<strong>getIconMode</strong>
()
</code>
<div class="description">
</div>
</div>
<hr />
<h4><a name="getNodeHtml">getNodeHtml</a></h4>
<div class="detail">
<code>
Object
<strong>getNodeHtml</strong>
()
</code>
<div class="description">
Get the markup for the node. This is designed to be overrided so that we can
support different types of nodes.
<dl>
<dt>Returns:</dt>
<dd> The HTML that will render this node.</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getSiblings">getSiblings</a></h4>
<div class="detail">
<code>
Object
<strong>getSiblings</strong>
()
</code>
<div class="description">
Returns a node array of this node's siblings, null if none.
<dl>
<dt>Returns:</dt>
<dd>Node[]</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getStyle">getStyle</a></h4>
<div class="detail">
<code>
string
<strong>getStyle</strong>
()
</code>
<div class="description">
Returns the css style name for the toggle
<dl>
<dt>Returns:</dt>
<dd> the css class for this node's toggle</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getToggleEl">getToggleEl</a></h4>
<div class="detail">
<code>
HTMLElement
<strong>getToggleEl</strong>
()
</code>
<div class="description">
Returns the element that is being used for this node's toggle.
<dl>
<dt>Returns:</dt>
<dd> this node's toggle html element</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getToggleElId">getToggleElId</a></h4>
<div class="detail">
<code>
string
<strong>getToggleElId</strong>
()
</code>
<div class="description">
Returns the id for this node's toggle element
<dl>
<dt>Returns:</dt>
<dd> the toggel element id</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="getToggleLink">getToggleLink</a></h4>
<div class="detail">
<code>
string
<strong>getToggleLink</strong>
()
</code>
<div class="description">
Generates the link that will invoke this node's toggle method
<dl>
<dt>Returns:</dt>
<dd> the javascript url for toggling this node</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="hasChildren">hasChildren</a></h4>
<div class="detail">
<code>
boolean
<strong>hasChildren</strong>
(checkForLazyLoad)
</code>
<div class="description">
Checks if this node has children. If this node is lazy-loading and the
children have not been rendered, we do not know whether or not there
are actual children. In most cases, we need to assume that there are
children (for instance, the toggle needs to show the expandable
presentation state). In other times we want to know if there are rendered
children. For the latter, "checkForLazyLoad" should be false.
<dl>
<dt>Parameters:</dt>
<dd>
<code>checkForLazyLoad</code> -
{boolean} should we check for unloaded children?
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> true if this has children or if it might and we are checking for this condition.</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="hideChildren">hideChildren</a></h4>
<div class="detail">
<code>
void
<strong>hideChildren</strong>
()
</code>
<div class="description">
Hides this node's children
</div>
</div>
<hr />
<h4><a name="init">init</a></h4>
<div class="detail">
<code>
void
<strong>init</strong>
(oData, oParent, expanded)
</code>
<div class="description">
Initializes this node, gets some of the properties from the parent
<dl>
<dt>Parameters:</dt>
<dd>
<code>oData</code> -
{object} a string or object containing the data that will be used to render this node
</dd>
<dd>
<code>oParent</code> -
{Node} this node's parent node
</dd>
<dd>
<code>expanded</code> -
{boolean} the initial expanded/collapsed state
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="insertAfter">insertAfter</a></h4>
<div class="detail">
<code>
Node
<strong>insertAfter</strong>
(node)
</code>
<div class="description">
Inserts this node after the supplied node
<dl>
<dt>Parameters:</dt>
<dd>
<code>node</code> -
{Node} the node to insert after
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> the inserted node</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="insertBefore">insertBefore</a></h4>
<div class="detail">
<code>
Node
<strong>insertBefore</strong>
(node)
</code>
<div class="description">
Inserts this node before this supplied node
<dl>
<dt>Parameters:</dt>
<dd>
<code>node</code> -
{Node} the node to insert this node before
</dd>
</dl>
<dl>
<dt>Returns:</dt>
<dd> the inserted node</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="isDynamic">isDynamic</a></h4>
<div class="detail">
<code>
boolean
<strong>isDynamic</strong>
()
</code>
<div class="description">
Evaluates if this node's children should be loaded dynamically. Looks for
the property both in this instance and the root node. If the tree is
defined to load all children dynamically, the data callback function is
defined in the root node
<dl>
<dt>Returns:</dt>
<dd> true if this node's children are to be loaded dynamically</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="isRoot">isRoot</a></h4>
<div class="detail">
<code>
boolean
<strong>isRoot</strong>
()
</code>
<div class="description">
Evaluates if this node is the root node of the tree
<dl>
<dt>Returns:</dt>
<dd> true if this is the root node</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="loadComplete">loadComplete</a></h4>
<div class="detail">
<code>
void
<strong>loadComplete</strong>
()
</code>
<div class="description">
Load complete is the callback function we pass to the data provider
in dynamic load situations.
</div>
</div>
<hr />
<h4><a name="refresh">refresh</a></h4>
<div class="detail">
<code>
void
<strong>refresh</strong>
()
</code>
<div class="description">
Regenerates the html for this node and its children. To be used when the
node is expanded and new children have been added.
</div>
</div>
<hr />
<h4><a name="setDynamicLoad">setDynamicLoad</a></h4>
<div class="detail">
<code>
void
<strong>setDynamicLoad</strong>
(fnDataLoader, iconMode)
</code>
<div class="description">
Configures this node for dynamically obtaining the child data
when the node is first expanded. Calling it without the callback
will turn off dynamic load for the node.
<dl>
<dt>Parameters:</dt>
<dd>
<code>iconMode</code> -
{int} configures the icon that is displayed when a dynamic load node is expanded the first time without children. By default, the "collapse" icon will be used. If set to 1, the leaf node icon will be displayed.
</dd>
<dd>
<code>fmDataLoader</code> -
{function} the function that will be used to get the data.
</dd>
</dl>
</div>
</div>
<hr />
<h4><a name="showChildren">showChildren</a></h4>
<div class="detail">
<code>
void
<strong>showChildren</strong>
()
</code>
<div class="description">
Shows this node's children
</div>
</div>
<hr />
<h4><a name="toggle">toggle</a></h4>
<div class="detail">
<code>
void
<strong>toggle</strong>
()
</code>
<div class="description">
Expands if node is collapsed, collapses otherwise.
</div>
</div>
<hr />
<h4><a name="toString">toString</a></h4>
<div class="detail">
<code>
Object
<strong>toString</strong>
()
</code>
<div class="description">
toString
<dl>
<dt>Returns:</dt>
<dd> string representation of the node</dd>
</dl>
</div>
</div>
<hr />
</div>
</div>
<!-- ============ METHOD DETAIL END ========== -->
</div>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<div id="footer">
<hr />
Copyright &copy; 2004 - 2006 Yahoo! Inc. All rights reserved.
</div>
</body>
</html>