1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <meta http-equiv="content-type" content="text/html; charset=undefined" />
8 <meta name="generator" content="JsDoc Toolkit" />
11 <title>JsDoc Reference - Roo.data.Tree</title>
14 <link rel="stylesheet" type="text/css" href="../../css/roojs.css" />
15 <link rel="stylesheet" type="text/css" href="../default.css" />
18 <script type="text/javascript" src="../page.js">
25 <body onload="RooDocsPage.onload();">
28 <div class="body-wrap">
30 <!-- ============================== links to methods. ================================= -->
32 <div class="top-tools">
34 <a class="inner-link" href="#Roo.data.Tree-props"><img src="resources/s.gif" class="item-icon icon-prop">Properties</a>
35 <a class="inner-link" href="#Roo.data.Tree-methods"><img src="resources/s.gif" class="item-icon icon-method">Methods</a>
36 <a class="inner-link" href="#Roo.data.Tree-events"><img src="resources/s.gif" class="item-icon icon-event">Events</a>
37 <a class="inner-link" href="#Roo.data.Tree-configs"><img src="resources/s.gif" class="item-icon icon-config">Config Options</a>
38 <a class="bookmark" href="NEED_TO_CREATE_DIRECT_LINK_HREF"><img src="resources/s.gif" class="item-icon icon-fav">Direct Link</a>
43 <!-- ============================== inheritance Block. ================================= -->
45 <div class="inheritance res-block">
46 <pre class="res-block-inner"><a href="./Roo.util.Observable.html#constructor" roo:cls="Roo.util.Observable.html#constructor">Roo.util.Observable</a>
47 <img src="../../images/default/s.gif" height="1" width="20"/><img class="elbow" src="../../images/default/tree/elbow-end.gif"/>Roo.data.Tree
52 <!-- ============================== class title / details ============================ -->
55 <h1 class="classTitle">
60 <table cellspacing="0" class="class-summary-table">
62 <tr><td class="label">Package:</td><td class="hd-info">Roo.data</td></tr>
64 <tr><td class="label">Defined In:</td><td class="hd-info">
66 <a href="./src/Roo_data_Tree.js.html">Roo/data/Tree.js</a>.
69 <tr><td class="label">Class:</td><td class="hd-info">Tree</td></tr>
74 <tr><td class="label">Extends:</td><td class="hd-info">
75 <a href="./Roo.util.Observable.html#constructor" roo:cls="Roo.util.Observable.html#constructor">Roo.util.Observable</a>
83 <!-- ============================== class summary ========================== -->
84 <div class="description">
85 Represents a tree data structure and bubbles all the events for its nodes. The nodes<br/>in the tree have most standard DOM functionality.
89 <!-- ============================== Class comment block... ========================== -->
91 <div class="comments">
92 <b>Class Comments / Notes</B> =>
93 <u onclick="parent.CommentDialog.showCommentId = 'Roo.data.Tree';">[Add Your comment/notes about this class]</u>
95 <iframe frameborder="0" id="comments-Roo.data" style="border: none;width:100%;"
96 src="/blog.php/GtkDjsComments/Roo.data.Tree.html"></iframe>
101 <!-- ============================== config options ========================== -->
106 <div class="hr"></div>
107 <a id="Roo.data.Tree-configs"></a>
111 <table cellspacing="0" class="member-table">
112 <caption class="Empty">Config Options - Has None</caption>
126 <!-- ============================== public properties ==================== -->
130 <a id="Roo.data.Tree-props"></a>
136 <table cellspacing="0" class="member-table">
137 <caption class="Empty">Public Properties - Has None</caption>
143 <!-- ============================== methods summary / details ======================== -->
146 <a id="Roo.data.Tree-methods"></a>
147 <!-- constructor?? -->
154 <!-- then dynamics first -->
161 <table cellspacing="0" class="member-table">
162 <caption>Public Methods</caption>
164 <th class="sig-header" colspan="2">Method</th>
165 <th class="msource-header">Defined By</th>
175 <tr class="method-row config-row-alt0 expandable notInherited">
176 <td class="micon"><a class="exi" href="#expand"> </a></td>
180 <a id="Roo.data-method-Tree" name=".Tree"></a>
181 <div class="fixedFont">
182 <span class="attributes">new <B>Roo.data.</B></span><b class="itemname">Tree</b>
184 (Node <B><i>root</i></B>)
192 <div class="short">Create a new Roo.data.Tree</div>
199 Create a new Roo.data.Tree
202 <dl class="detailList">
203 <dt class="heading">Parameters:</dt>
206 <span class="fixedFont">Node</span> <b>root</b>
209 <dd>(optional) The root node</dd>
233 <tr class="method-row config-row-alt1 expandable notInherited">
234 <td class="micon"><a class="exi" href="#expand"> </a></td>
238 <a id="Roo.data.Tree-method-getNodeById" name=".getNodeById"></a>
239 <div class="fixedFont">
240 <span class="attributes"></span><b class="itemname">getNodeById</b>
242 (<a href="./String.html#constructor" roo:cls="String.html#constructor">String</a> <B><i>id</i></B>)
257 <div class="short">Gets a node in this tree by its id.</div>
263 Gets a node in this tree by its id.
270 <dl class="detailList">
271 <dt class="heading">Parameters:</dt>
274 <span class="fixedFont"><a href="./String.html#constructor" roo:cls="String.html#constructor">String</a></span> <b>id</b>
285 <dl class="detailList">
286 <dt class="heading">Returns:</dt>
288 <dd><span class="fixedFont">Node</span> </dd>
310 <tr class="method-row config-row-alt0 expandable notInherited">
311 <td class="micon"><a class="exi" href="#expand"> </a></td>
315 <a id="Roo.data.Tree-method-getRootNode" name=".getRootNode"></a>
316 <div class="fixedFont">
317 <span class="attributes"></span><b class="itemname">getRootNode</b>
334 <div class="short">Returns the root node for this tree.</div>
340 Returns the root node for this tree.
351 <dl class="detailList">
352 <dt class="heading">Returns:</dt>
354 <dd><span class="fixedFont">Node</span> </dd>
376 <tr class="method-row config-row-alt1 expandable notInherited">
377 <td class="micon"><a class="exi" href="#expand"> </a></td>
381 <a id="Roo.data.Tree-method-setRootNode" name=".setRootNode"></a>
382 <div class="fixedFont">
383 <span class="attributes"></span><b class="itemname">setRootNode</b>
385 (Node <B><i>node</i></B>)
400 <div class="short">Sets the root node for this tree.</div>
406 Sets the root node for this tree.
413 <dl class="detailList">
414 <dt class="heading">Parameters:</dt>
417 <span class="fixedFont">Node</span> <b>node</b>
428 <dl class="detailList">
429 <dt class="heading">Returns:</dt>
431 <dd><span class="fixedFont">Node</span> </dd>
456 <!-- ============================== events summary / details ======================== -->
459 <a id="Roo.data.Tree-events"></a>
468 <table cellspacing="0" class="member-table">
469 <caption>Events</caption>
472 <th class="sig-header" colspan="2">Event</th>
473 <th class="msource-header">Defined By</th>
482 <tr class="method-row expandable config-row-alt0 notInherited">
483 <td class="micon"><a class="exi" href="#expand"> </a></td>
486 <a id="Roo.data.Tree-event-*append"></a>
488 <div class="fixedFont">
489 <b class="itemname">append</b> (Tree <B><i>tree</i></B>, Node <B><i>parent</i></B>, Node <B><i>node</i></B>, <a href="./Number.html#constructor" roo:cls="Number.html#constructor">Number</a> <B><i>index</i></B>)
495 <div class="short">Fires when a new child node is appended to a node in this tree.
501 Fires when a new child node is appended to a node in this tree.
507 <dl class="detailList">
508 <dt class="heading">Parameters:</dt>
511 <span class="fixedFont">Tree</span> <b>tree</b>
514 <dd>The owner tree</dd>
517 <span class="fixedFont">Node</span> <b>parent</b>
520 <dd>The parent node</dd>
523 <span class="fixedFont">Node</span> <b>node</b>
526 <dd>The newly appended node</dd>
529 <span class="fixedFont"><a href="./Number.html#constructor" roo:cls="Number.html#constructor">Number</a></span> <b>index</b>
532 <dd>The index of the newly appended node</dd>
555 <tr class="method-row expandable config-row-alt1 notInherited">
556 <td class="micon"><a class="exi" href="#expand"> </a></td>
559 <a id="Roo.data.Tree-event-*beforeappend"></a>
561 <div class="fixedFont">
562 <b class="itemname">beforeappend</b> (Tree <B><i>tree</i></B>, Node <B><i>parent</i></B>, Node <B><i>node</i></B>)
568 <div class="short">Fires before a new child is appended to a node in this tree, return false to cancel the append.
574 Fires before a new child is appended to a node in this tree, return false to cancel the append.
580 <dl class="detailList">
581 <dt class="heading">Parameters:</dt>
584 <span class="fixedFont">Tree</span> <b>tree</b>
587 <dd>The owner tree</dd>
590 <span class="fixedFont">Node</span> <b>parent</b>
593 <dd>The parent node</dd>
596 <span class="fixedFont">Node</span> <b>node</b>
599 <dd>The child node to be appended</dd>
622 <tr class="method-row expandable config-row-alt0 notInherited">
623 <td class="micon"><a class="exi" href="#expand"> </a></td>
626 <a id="Roo.data.Tree-event-*beforeinsert"></a>
628 <div class="fixedFont">
629 <b class="itemname">beforeinsert</b> (Tree <B><i>tree</i></B>, Node <B><i>parent</i></B>, Node <B><i>node</i></B>, Node <B><i>refNode</i></B>)
635 <div class="short">Fires before a new child is inserted in a node in this tree, return false to cancel the insert.
641 Fires before a new child is inserted in a node in this tree, return false to cancel the insert.
647 <dl class="detailList">
648 <dt class="heading">Parameters:</dt>
651 <span class="fixedFont">Tree</span> <b>tree</b>
654 <dd>The owner tree</dd>
657 <span class="fixedFont">Node</span> <b>parent</b>
660 <dd>The parent node</dd>
663 <span class="fixedFont">Node</span> <b>node</b>
666 <dd>The child node to be inserted</dd>
669 <span class="fixedFont">Node</span> <b>refNode</b>
672 <dd>The child node the node is being inserted before</dd>
695 <tr class="method-row expandable config-row-alt1 notInherited">
696 <td class="micon"><a class="exi" href="#expand"> </a></td>
699 <a id="Roo.data.Tree-event-*beforemove"></a>
701 <div class="fixedFont">
702 <b class="itemname">beforemove</b> (Tree <B><i>tree</i></B>, Node <B><i>node</i></B>, Node <B><i>oldParent</i></B>, Node <B><i>newParent</i></B>, <a href="./Number.html#constructor" roo:cls="Number.html#constructor">Number</a> <B><i>index</i></B>)
708 <div class="short">Fires before a node is moved to a new location in the tree.
714 Fires before a node is moved to a new location in the tree. Return false to cancel the move.
720 <dl class="detailList">
721 <dt class="heading">Parameters:</dt>
724 <span class="fixedFont">Tree</span> <b>tree</b>
727 <dd>The owner tree</dd>
730 <span class="fixedFont">Node</span> <b>node</b>
733 <dd>The node being moved</dd>
736 <span class="fixedFont">Node</span> <b>oldParent</b>
739 <dd>The parent of the node</dd>
742 <span class="fixedFont">Node</span> <b>newParent</b>
745 <dd>The new parent the node is moving to</dd>
748 <span class="fixedFont"><a href="./Number.html#constructor" roo:cls="Number.html#constructor">Number</a></span> <b>index</b>
751 <dd>The index it is being moved to</dd>
774 <tr class="method-row expandable config-row-alt0 notInherited">
775 <td class="micon"><a class="exi" href="#expand"> </a></td>
778 <a id="Roo.data.Tree-event-*beforeremove"></a>
780 <div class="fixedFont">
781 <b class="itemname">beforeremove</b> (Tree <B><i>tree</i></B>, Node <B><i>parent</i></B>, Node <B><i>node</i></B>)
787 <div class="short">Fires before a child is removed from a node in this tree, return false to cancel the remove.
793 Fires before a child is removed from a node in this tree, return false to cancel the remove.
799 <dl class="detailList">
800 <dt class="heading">Parameters:</dt>
803 <span class="fixedFont">Tree</span> <b>tree</b>
806 <dd>The owner tree</dd>
809 <span class="fixedFont">Node</span> <b>parent</b>
812 <dd>The parent node</dd>
815 <span class="fixedFont">Node</span> <b>node</b>
818 <dd>The child node to be removed</dd>
841 <tr class="method-row expandable config-row-alt1 notInherited">
842 <td class="micon"><a class="exi" href="#expand"> </a></td>
845 <a id="Roo.data.Tree-event-*insert"></a>
847 <div class="fixedFont">
848 <b class="itemname">insert</b> (Tree <B><i>tree</i></B>, Node <B><i>parent</i></B>, Node <B><i>node</i></B>, Node <B><i>refNode</i></B>)
854 <div class="short">Fires when a new child node is inserted in a node in this tree.
860 Fires when a new child node is inserted in a node in this tree.
866 <dl class="detailList">
867 <dt class="heading">Parameters:</dt>
870 <span class="fixedFont">Tree</span> <b>tree</b>
873 <dd>The owner tree</dd>
876 <span class="fixedFont">Node</span> <b>parent</b>
879 <dd>The parent node</dd>
882 <span class="fixedFont">Node</span> <b>node</b>
885 <dd>The child node inserted</dd>
888 <span class="fixedFont">Node</span> <b>refNode</b>
891 <dd>The child node the node was inserted before</dd>
914 <tr class="method-row expandable config-row-alt0 notInherited">
915 <td class="micon"><a class="exi" href="#expand"> </a></td>
918 <a id="Roo.data.Tree-event-*move"></a>
920 <div class="fixedFont">
921 <b class="itemname">move</b> (Tree <B><i>tree</i></B>, Node <B><i>node</i></B>, Node <B><i>oldParent</i></B>, Node <B><i>newParent</i></B>, <a href="./Number.html#constructor" roo:cls="Number.html#constructor">Number</a> <B><i>index</i></B>)
927 <div class="short">Fires when a node is moved to a new location in the tree
933 Fires when a node is moved to a new location in the tree
939 <dl class="detailList">
940 <dt class="heading">Parameters:</dt>
943 <span class="fixedFont">Tree</span> <b>tree</b>
946 <dd>The owner tree</dd>
949 <span class="fixedFont">Node</span> <b>node</b>
952 <dd>The node moved</dd>
955 <span class="fixedFont">Node</span> <b>oldParent</b>
958 <dd>The old parent of this node</dd>
961 <span class="fixedFont">Node</span> <b>newParent</b>
964 <dd>The new parent of this node</dd>
967 <span class="fixedFont"><a href="./Number.html#constructor" roo:cls="Number.html#constructor">Number</a></span> <b>index</b>
970 <dd>The index it was moved to</dd>
993 <tr class="method-row expandable config-row-alt1 notInherited">
994 <td class="micon"><a class="exi" href="#expand"> </a></td>
997 <a id="Roo.data.Tree-event-*remove"></a>
999 <div class="fixedFont">
1000 <b class="itemname">remove</b> (Tree <B><i>tree</i></B>, Node <B><i>parent</i></B>, Node <B><i>node</i></B>)
1006 <div class="short">Fires when a child node is removed from a node in this tree.
1012 Fires when a child node is removed from a node in this tree.
1018 <dl class="detailList">
1019 <dt class="heading">Parameters:</dt>
1022 <span class="fixedFont">Tree</span> <b>tree</b>
1025 <dd>The owner tree</dd>
1028 <span class="fixedFont">Node</span> <b>parent</b>
1031 <dd>The parent node</dd>
1034 <span class="fixedFont">Node</span> <b>node</b>
1037 <dd>The child node removed</dd>
1055 <td class="msource">
1067 <!-- ============================== footer ================================= -->
1068 <div class="fineprint" style="clear:both">
1070 Documentation generated by <a href="http://www.akbkhome.com" target="_blankt">Introspection Doc Generator</a> on Fri Jul 16 2010 16:11:53 GMT+0800 (HKT)
1072 <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a>