922 lines
No EOL
48 KiB
HTML
922 lines
No EOL
48 KiB
HTML
<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<title>YAHOO.widget.TreeView</title>
|
|
<link rel="stylesheet" type="text/css" href="../resources/reset.css"/>
|
|
<link rel="stylesheet" type="text/css" href="../resources/style.css" media="screen"/>
|
|
<link rel="stylesheet" type="text/css" href="../resources/print.css" media="print">
|
|
</head>
|
|
<body>
|
|
<div class="body-wrap">
|
|
<div class="top-tools"><img src="../resources/print.gif" width="16" height="16" align="absmiddle"> <a href="YAHOO.widget.TreeView.html" target="_blank">Print Friendly</a></div>
|
|
<h1>Class YAHOO.widget.TreeView</h1>
|
|
<table cellspacing="0">
|
|
<tr><td class="label">Package:</td><td>YAHOO.widget</td></tr>
|
|
<tr><td class="label">Class:</td><td>TreeView</td></tr>
|
|
<tr><td class="label">Extends:</td><td>Object</td></tr>
|
|
<tr><td class="label">Defined In:</td><td><a href="treeview.js.html">treeview.js</a></td></tr>
|
|
</table>
|
|
<div class="description">
|
|
Contains the tree view state data and the root node. </div>
|
|
<hr />
|
|
<a name="properties"></a>
|
|
<h2>Public Properties</h2>
|
|
<table cellspacing="0" class="member-table">
|
|
<tr>
|
|
<th class="sig-header" colspan="2">Property</th>
|
|
<th class="msource-header">Defined By</th>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#id">id</a> : String</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">The id of tree container element</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#locked">locked</a> : boolean</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">We lock the tree control while waiting for the dynamic loader to return</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#maxAnim">maxAnim</a> : int</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">The maximum number of animations to run at one time.</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#nodeCount<static>">nodeCount<static></a> : int</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc"><static> Count of all nodes in all trees</td>
|
|
</tr>
|
|
</table>
|
|
<a name="methods"></a>
|
|
<h2>Public Methods</h2>
|
|
<table cellspacing="0" class="member-table">
|
|
<tr>
|
|
<th class="sig-header" colspan="2">Method</th>
|
|
<th class="msource-header">Defined By</th>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#TreeView">TreeView</a>(<code>string|HTMLElement id</code>)</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc"></td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#addHandler<static>">addHandler<static></a>(<code>el the</code>, <code>string sType</code>, <code>function fn</code>) : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc"><static> Add a DOM event</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#animateCollapse">animateCollapse</a>(<code>el {HTMLElement}</code>, <code>node {YAHOO.util.Node}</code>) : boolean</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Perform the collapse animation if configured, or just show the
|
|
element if not configured or too many animations are i...</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#animateExpand">animateExpand</a>(<code>el {HTMLElement}</code>, <code>node {YAHOO.util.Node}</code>) : boolean</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Perform the expand animation if configured, or just show the
|
|
element if not configured or too many animations are in ...</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#collapseAll">collapseAll</a>() : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Collapses all expanded child nodes in the entire tree.</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#collapseComplete">collapseComplete</a>() : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Function executed when the collapse animation completes</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#draw">draw</a>() : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Renders the tree boilerplate and visible nodes</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#expandAll">expandAll</a>() : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Expands all child nodes. Note: this conflicts with the "multiExpand"
|
|
node property. If expand all is called in a tr...</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#expandComplete">expandComplete</a>() : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Function executed when the expand animation completes</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#getEl">getEl</a>() : HTMLElement</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Returns the tree's host element</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#getNode<static>">getNode<static></a>(<code>treeId {String}</code>, <code>nodeIndex {String}</code>) : Node</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc"><static> Global method for getting a node by its id. Used in the generated
|
|
tree html.</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#getNodeByIndex">getNodeByIndex</a>(<code>int nodeIndex</code>) : Node</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Returns a node in the tree that has the specified index (this index
|
|
is created internally, so this function probably ...</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#getNodeByProperty">getNodeByProperty</a>(<code>object property</code>, <code>object value</code>) : Node</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Returns a node that has a matching property and value in the data
|
|
object that was passed into its constructor.</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#getNodesByProperty">getNodesByProperty</a>(<code>object property</code>, <code>object value</code>) : Array</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Returns a collection of nodes that have a matching property
|
|
and value in the data object that was passed into its co...</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#getRoot">getRoot</a>() : Node</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Returns the root node of this tree</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#getTree<static>">getTree<static></a>(<code>treeId {String}</code>) : TreeView</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc"><static> Global method for getting a tree by its id. Used in the generated
|
|
tree html.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#onCollapse">onCollapse</a>(<code>node {Node}</code>) : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc"><b>Deprecated.</b> Abstract method that is executed when a node is collapsed.</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#onExpand">onExpand</a>(<code>node {Node}</code>) : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc"><b>Deprecated.</b> Abstract method that is executed when a node is expanded</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#popNode">popNode</a>(<code>Node the</code>) : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Removes the node from the tree, preserving the child collection
|
|
to make it possible to insert the branch into anothe...</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#preload<static>">preload<static></a>(<code>string prefix</code>) : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc"><static> Attempts to preload the images defined in the styles used to draw the tree by
|
|
rendering off-screen ele...</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#removeChildren">removeChildren</a>(<code>Node node</code>) : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Deletes this nodes child collection, recursively. Also collapses
|
|
the node, and resets the dynamic load flag. The pr...</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#removeHandler<static>">removeHandler<static></a>(<code>el the</code>, <code>string sType</code>, <code>function fn</code>) : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc"><static> Remove a DOM event</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#removeNode">removeNode</a>(<code>Node The</code>, <code>boolean autoRefresh</code>) : boolean</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Removes the node and its children, and optionally refreshes the
|
|
branch of the tree that was affected.</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#setCollapseAnim">setCollapseAnim</a>(<code>string the</code>) : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Sets up the animation for collapsing children</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#setDynamicLoad">setDynamicLoad</a>(<code>function fnDataLoader</code>, <code>iconMode {int}</code>) : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Configures this tree to dynamically load all child data</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#setExpandAnim">setExpandAnim</a>(<code>string type</code>) : void</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Sets up the animation for expanding children</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#toString">toString</a>() : string</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">TreeView instance toString</td>
|
|
</tr>
|
|
</table>
|
|
<a name="events"></a>
|
|
<h2>Public Events</h2>
|
|
<table cellspacing="0" class="member-table">
|
|
<tr>
|
|
<th class="sig-header" colspan="2">Event</th>
|
|
<th class="msource-header">Defined By</th>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#event-animComplete">animComplete</a> : (<code>YAHOO.widget.Node node</code>)</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">When animation is enabled, this event fires when the animation
|
|
completes</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#event-animStart">animStart</a> : (<code>YAHOO.widget.Node node</code>)</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">When animation is enabled, this event fires when the animation
|
|
starts</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#event-collapse">collapse</a> : (<code>YAHOO.widget.Node node</code>)</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="mdesc">Fires when a node is going to be expanded. Return false to stop
|
|
the expand.</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="micon" rowspan="2"> </td>
|
|
<td class="sig"><a class="mlink" href="#event-expand">expand</a> : (<code>YAHOO.widget.Node node</code>)</td>
|
|
<td class="msource" rowspan="2">TreeView</td>
|
|
</tr>
|
|
<tr class="alt">
|
|
<td class="mdesc">Fires when a node is going to be collapsed. Return false to stop
|
|
the collapse.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h2 class="mdetail-head">Property Details</h2>
|
|
<div class="detail-wrap">
|
|
<a name="id"></a>
|
|
<div class="mdetail">
|
|
<h3>id</i></h3>
|
|
<code>public String id</code>
|
|
<div class="mdetail-desc">
|
|
The id of tree container element </div>
|
|
<div class="mdetail-def">This property is defined by TreeView.</div>
|
|
</div>
|
|
<a name="locked"></a>
|
|
<div class="mdetail alt">
|
|
<h3>locked</i></h3>
|
|
<code>public boolean locked</code>
|
|
<div class="mdetail-desc">
|
|
We lock the tree control while waiting for the dynamic loader to return </div>
|
|
<div class="mdetail-def">This property is defined by TreeView.</div>
|
|
</div>
|
|
<a name="maxAnim"></a>
|
|
<div class="mdetail">
|
|
<h3>maxAnim</i></h3>
|
|
<code>public int maxAnim</code>
|
|
<div class="mdetail-desc">
|
|
The maximum number of animations to run at one time. </div>
|
|
<div class="mdetail-def">This property is defined by TreeView.</div>
|
|
</div>
|
|
<a name="nodeCount<static>"></a>
|
|
<div class="mdetail alt">
|
|
<h3>nodeCount<static></i></h3>
|
|
<code>public int nodeCount<static></code>
|
|
<div class="mdetail-desc">
|
|
<static> Count of all nodes in all trees </div>
|
|
<div class="mdetail-def">This property is defined by TreeView.</div>
|
|
</div>
|
|
</div>
|
|
|
|
<a name="TreeView"></a>
|
|
<h2 class="mdetail-head">Constructor Details</h2>
|
|
<div class="detail-wrap">
|
|
<div class="mdetail">
|
|
<h3>TreeView</i></h3>
|
|
<code>public function TreeView(<code>string|HTMLElement id</code>)</code>
|
|
<div class="mdetail-desc">
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>id</code> : string|HTMLElement<div class="sub-desc">The id of the element, or the element itself that the tree will be inserted into.</div></li> </ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<h2 class="mdetail-head">Method Details</h2>
|
|
<div class="detail-wrap">
|
|
<a name="addHandler<static>"></a>
|
|
<div class="mdetail">
|
|
<h3>addHandler<static></i></h3>
|
|
<code>public function addHandler<static>(<code>el the</code>, <code>string sType</code>, <code>function fn</code>)</code>
|
|
<div class="mdetail-desc">
|
|
<static> Add a DOM event
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>the</code> : el<div class="sub-desc">elment to bind the handler to</div></li><li><code>sType</code> : string<div class="sub-desc">the type of event handler</div></li><li><code>fn</code> : function<div class="sub-desc">the callback to invoke</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="animateCollapse"></a>
|
|
<div class="mdetail alt">
|
|
<h3>animateCollapse</i></h3>
|
|
<code>public function animateCollapse(<code>el {HTMLElement}</code>, <code>node {YAHOO.util.Node}</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Perform the collapse animation if configured, or just show the
|
|
element if not configured or too many animations are in progress
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>{HTMLElement}</code> : el<div class="sub-desc">the element to animate</div></li><li><code>{YAHOO.util.Node}</code> : node<div class="sub-desc">the node that was expanded</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>boolean</code><div class="sub-desc">true if animation could be invoked, false otherwise</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="animateExpand"></a>
|
|
<div class="mdetail">
|
|
<h3>animateExpand</i></h3>
|
|
<code>public function animateExpand(<code>el {HTMLElement}</code>, <code>node {YAHOO.util.Node}</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Perform the expand animation if configured, or just show the
|
|
element if not configured or too many animations are in progress
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>{HTMLElement}</code> : el<div class="sub-desc">the element to animate</div></li><li><code>{YAHOO.util.Node}</code> : node<div class="sub-desc">the node that was expanded</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>boolean</code><div class="sub-desc">true if animation could be invoked, false otherwise</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="collapseAll"></a>
|
|
<div class="mdetail alt">
|
|
<h3>collapseAll</i></h3>
|
|
<code>public function collapseAll()</code>
|
|
<div class="mdetail-desc">
|
|
Collapses all expanded child nodes in the entire tree.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li>None.</li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="collapseComplete"></a>
|
|
<div class="mdetail">
|
|
<h3>collapseComplete</i></h3>
|
|
<code>public function collapseComplete()</code>
|
|
<div class="mdetail-desc">
|
|
Function executed when the collapse animation completes
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li>None.</li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="draw"></a>
|
|
<div class="mdetail alt">
|
|
<h3>draw</i></h3>
|
|
<code>public function draw()</code>
|
|
<div class="mdetail-desc">
|
|
Renders the tree boilerplate and visible nodes
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li>None.</li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="expandAll"></a>
|
|
<div class="mdetail">
|
|
<h3>expandAll</i></h3>
|
|
<code>public function expandAll()</code>
|
|
<div class="mdetail-desc">
|
|
Expands all child nodes. Note: this conflicts with the "multiExpand"
|
|
node property. If expand all is called in a tree with nodes that
|
|
do not allow multiple siblings to be displayed, only the last sibling
|
|
will be expanded.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li>None.</li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="expandComplete"></a>
|
|
<div class="mdetail alt">
|
|
<h3>expandComplete</i></h3>
|
|
<code>public function expandComplete()</code>
|
|
<div class="mdetail-desc">
|
|
Function executed when the expand animation completes
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li>None.</li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="getEl"></a>
|
|
<div class="mdetail">
|
|
<h3>getEl</i></h3>
|
|
<code>public function getEl()</code>
|
|
<div class="mdetail-desc">
|
|
Returns the tree's host element
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li>None.</li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>HTMLElement</code><div class="sub-desc">the host element</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="getNode<static>"></a>
|
|
<div class="mdetail alt">
|
|
<h3>getNode<static></i></h3>
|
|
<code>public function getNode<static>(<code>treeId {String}</code>, <code>nodeIndex {String}</code>)</code>
|
|
<div class="mdetail-desc">
|
|
<static> Global method for getting a node by its id. Used in the generated
|
|
tree html.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>{String}</code> : treeId<div class="sub-desc">the id of the tree instance</div></li><li><code>{String}</code> : nodeIndex<div class="sub-desc">the index of the node to return</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>Node</code><div class="sub-desc">the node instance requested, null if not found</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="getNodeByIndex"></a>
|
|
<div class="mdetail">
|
|
<h3>getNodeByIndex</i></h3>
|
|
<code>public function getNodeByIndex(<code>int nodeIndex</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Returns a node in the tree that has the specified index (this index
|
|
is created internally, so this function probably will only be used
|
|
in html generated for a given node.)
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>nodeIndex</code> : int<div class="sub-desc">the index of the node wanted</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>Node</code><div class="sub-desc">the node with index=nodeIndex, null if no match</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="getNodeByProperty"></a>
|
|
<div class="mdetail alt">
|
|
<h3>getNodeByProperty</i></h3>
|
|
<code>public function getNodeByProperty(<code>object property</code>, <code>object value</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Returns a node that has a matching property and value in the data
|
|
object that was passed into its constructor.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>property</code> : object<div class="sub-desc">the property to search (usually a string)</div></li><li><code>value</code> : object<div class="sub-desc">the value we want to find (usuall an int or string)</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>Node</code><div class="sub-desc">the matching node, null if no match</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="getNodesByProperty"></a>
|
|
<div class="mdetail">
|
|
<h3>getNodesByProperty</i></h3>
|
|
<code>public function getNodesByProperty(<code>object property</code>, <code>object value</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Returns a collection of nodes that have a matching property
|
|
and value in the data object that was passed into its constructor.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>property</code> : object<div class="sub-desc">the property to search (usually a string)</div></li><li><code>value</code> : object<div class="sub-desc">the value we want to find (usuall an int or string)</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>Array</code><div class="sub-desc">the matching collection of nodes, null if no match</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="getRoot"></a>
|
|
<div class="mdetail alt">
|
|
<h3>getRoot</i></h3>
|
|
<code>public function getRoot()</code>
|
|
<div class="mdetail-desc">
|
|
Returns the root node of this tree
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li>None.</li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>Node</code><div class="sub-desc">the root node</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="getTree<static>"></a>
|
|
<div class="mdetail">
|
|
<h3>getTree<static></i></h3>
|
|
<code>public function getTree<static>(<code>treeId {String}</code>)</code>
|
|
<div class="mdetail-desc">
|
|
<static> Global method for getting a tree by its id. Used in the generated
|
|
tree html.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>{String}</code> : treeId<div class="sub-desc">the id of the tree instance</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>TreeView</code><div class="sub-desc">the tree instance requested, null if not found.</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="onCollapse"></a>
|
|
<div class="mdetail alt">
|
|
<h3>onCollapse</i></h3>
|
|
<code>public function onCollapse(<code>node {Node}</code>)</code>
|
|
<div class="mdetail-desc">
|
|
<b>Deprecated.</b> Abstract method that is executed when a node is collapsed.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>{Node}</code> : node<div class="sub-desc">the node that was collapsed.</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="onExpand"></a>
|
|
<div class="mdetail">
|
|
<h3>onExpand</i></h3>
|
|
<code>public function onExpand(<code>node {Node}</code>)</code>
|
|
<div class="mdetail-desc">
|
|
<b>Deprecated.</b> Abstract method that is executed when a node is expanded
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>{Node}</code> : node<div class="sub-desc">the node that was expanded</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="popNode"></a>
|
|
<div class="mdetail alt">
|
|
<h3>popNode</i></h3>
|
|
<code>public function popNode(<code>Node the</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Removes the node from the tree, preserving the child collection
|
|
to make it possible to insert the branch into another part of the
|
|
tree, or another tree.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>the</code> : Node<div class="sub-desc">node to remove</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="preload<static>"></a>
|
|
<div class="mdetail">
|
|
<h3>preload<static></i></h3>
|
|
<code>public function preload<static>(<code>string prefix</code>)</code>
|
|
<div class="mdetail-desc">
|
|
<static> Attempts to preload the images defined in the styles used to draw the tree by
|
|
rendering off-screen elements that use the styles.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>prefix</code> : string<div class="sub-desc">the prefix to use to generate the names of the images to preload, default is ygtv</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="removeChildren"></a>
|
|
<div class="mdetail alt">
|
|
<h3>removeChildren</i></h3>
|
|
<code>public function removeChildren(<code>Node node</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Deletes this nodes child collection, recursively. Also collapses
|
|
the node, and resets the dynamic load flag. The primary use for
|
|
this method is to purge a node and allow it to fetch its data
|
|
dynamically again.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>node</code> : Node<div class="sub-desc">the node to purge</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="removeHandler<static>"></a>
|
|
<div class="mdetail">
|
|
<h3>removeHandler<static></i></h3>
|
|
<code>public function removeHandler<static>(<code>el the</code>, <code>string sType</code>, <code>function fn</code>)</code>
|
|
<div class="mdetail-desc">
|
|
<static> Remove a DOM event
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>the</code> : el<div class="sub-desc">elment to bind the handler to</div></li><li><code>sType</code> : string<div class="sub-desc">the type of event handler</div></li><li><code>fn</code> : function<div class="sub-desc">the callback to invoke</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="removeNode"></a>
|
|
<div class="mdetail alt">
|
|
<h3>removeNode</i></h3>
|
|
<code>public function removeNode(<code>Node The</code>, <code>boolean autoRefresh</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Removes the node and its children, and optionally refreshes the
|
|
branch of the tree that was affected.
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>The</code> : Node<div class="sub-desc">node to remove</div></li><li><code>autoRefresh</code> : boolean<div class="sub-desc">automatically refreshes branch if true</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>boolean</code><div class="sub-desc">False is there was a problem, true otherwise.</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="setCollapseAnim"></a>
|
|
<div class="mdetail">
|
|
<h3>setCollapseAnim</i></h3>
|
|
<code>public function setCollapseAnim(<code>string the</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Sets up the animation for collapsing children
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>the</code> : string<div class="sub-desc">type of animation (acceptable values defined in YAHOO.widget.TVAnim)</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="setDynamicLoad"></a>
|
|
<div class="mdetail alt">
|
|
<h3>setDynamicLoad</i></h3>
|
|
<code>public function setDynamicLoad(<code>function fnDataLoader</code>, <code>iconMode {int}</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Configures this tree to dynamically load all child data
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>fnDataLoader</code> : function<div class="sub-desc">the function that will be called to get the data</div></li><li><code>{int}</code> : iconMode<div class="sub-desc">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.</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="setExpandAnim"></a>
|
|
<div class="mdetail">
|
|
<h3>setExpandAnim</i></h3>
|
|
<code>public function setExpandAnim(<code>string type</code>)</code>
|
|
<div class="mdetail-desc">
|
|
Sets up the animation for expanding children
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li><code>type</code> : string<div class="sub-desc">the type of animation (acceptable values defined in YAHOO.widget.TVAnim)</div></li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>void</code></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
<a name="toString"></a>
|
|
<div class="mdetail alt">
|
|
<h3>toString</i></h3>
|
|
<code>public function toString()</code>
|
|
<div class="mdetail-desc">
|
|
TreeView instance toString
|
|
<div class="mdetail-params">
|
|
<strong>Parameters:</strong>
|
|
<ul><li>None.</li> </ul>
|
|
<strong>Returns:</strong>
|
|
<ul>
|
|
<li><code>string</code><div class="sub-desc">string representation of the tree</div></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This method is defined by TreeView.</div>
|
|
</div>
|
|
</div>
|
|
|
|
<h2 class="mdetail-head">Event Details</h2>
|
|
<div class="detail-wrap">
|
|
<a name="event-animComplete"></a>
|
|
<div class="mdetail">
|
|
<h3>animComplete</i></h3>
|
|
<code>public event animComplete</code>
|
|
<div class="mdetail-desc">
|
|
When animation is enabled, this event fires when the animation
|
|
completes
|
|
<div class="mdetail-params">
|
|
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
|
|
<ul><li><code>node</code> : YAHOO.widget.Node<div class="sub-desc">the node that is expanding/collapsing @parm {String} type the type of animation ("expand" or "collapse")</div></li> </ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This event is defined by TreeView.</div>
|
|
</div>
|
|
<a name="event-animStart"></a>
|
|
<div class="mdetail alt">
|
|
<h3>animStart</i></h3>
|
|
<code>public event animStart</code>
|
|
<div class="mdetail-desc">
|
|
When animation is enabled, this event fires when the animation
|
|
starts
|
|
<div class="mdetail-params">
|
|
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
|
|
<ul><li><code>node</code> : YAHOO.widget.Node<div class="sub-desc">the node that is expanding/collapsing @parm {String} type the type of animation ("expand" or "collapse")</div></li> </ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This event is defined by TreeView.</div>
|
|
</div>
|
|
<a name="event-collapse"></a>
|
|
<div class="mdetail">
|
|
<h3>collapse</i></h3>
|
|
<code>public event collapse</code>
|
|
<div class="mdetail-desc">
|
|
Fires when a node is going to be expanded. Return false to stop
|
|
the expand.
|
|
<div class="mdetail-params">
|
|
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
|
|
<ul><li><code>node</code> : YAHOO.widget.Node<div class="sub-desc">the node that is expanding/collapsing</div></li> </ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This event is defined by TreeView.</div>
|
|
</div>
|
|
<a name="event-expand"></a>
|
|
<div class="mdetail alt">
|
|
<h3>expand</i></h3>
|
|
<code>public event expand</code>
|
|
<div class="mdetail-desc">
|
|
Fires when a node is going to be collapsed. Return false to stop
|
|
the collapse.
|
|
<div class="mdetail-params">
|
|
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
|
|
<ul><li><code>node</code> : YAHOO.widget.Node<div class="sub-desc">the node that is expanding/collapsing</div></li> </ul>
|
|
</div>
|
|
</div>
|
|
<div class="mdetail-def">This event is defined by TreeView.</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
Copyright © 2006 Jack Slocum. All rights reserved.
|
|
</body>
|
|
</html>
|
|
|