Simple status box for the sidebar.
[elgg_plugins.git] / yui / docs / YAHOO.widget.TreeView.html
blobeb3f2865425ec5c90f41f2e0c5ea35d476d40c38
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <title>API: treeview YAHOO.widget.TreeView (YUI Library)</title>
5 <link rel="stylesheet" type="text/css" href="assets/api.css">
6 </head>
8 <body id="yahoo-com">
9 <div id="doc3" class="yui-t2">
11 <div id="hd">
12 <h1>Yahoo! UI Library</h1>
13 <h3>TreeView Widget&nbsp; <span class="subtitle">2.2.0</span></h3>
14 <p>
15 <a href="./index.html">Yahoo! UI Library</a>
16 &gt; <a href="./module_treeview.html">treeview</a>
17 &gt; YAHOO.widget.TreeView
19 </p>
20 </div>
22 <div id="bd">
23 <div id="yui-main">
24 <div class="yui-b">
27 <h2>
32 Class <b>YAHOO.widget.TreeView</b>
33 <span class="extends">
34 </span>
36 <span class="extends">
37 - uses
39 <a href="YAHOO.util.EventProvider.html">YAHOO.util.EventProvider</a>
41 </span>
43 </code>
44 </h2>
45 <!-- class tree goes here -->
50 <div class="summary description">
51 Contains the tree view state data and the root node.
52 </div>
54 <div class="section constructor details">
55 <h3><a name="constructor_detail">Constructor</a></h3>
56 <div class="content">
57 <div class="detail">
58 <strong>YAHOO.widget.TreeView</strong>
59 <code>
66 </code>
67 <div class="description">
68 <dl>
69 <dt>Parameters:</dt>
70 <dd>
71 <code>id
72 &lt;string|HTMLElement&gt;
73 </code>
74 The id of the element, or the element
75 itself that the tree will be inserted into.
76 </dd>
77 </dl>
80 </div>
81 </div>
82 </div>
83 </div>
85 <div class="section field details">
86 <h3><a name="field_detail">Properties</a></h3>
87 <div class="content">
88 <h4><a name="_animCount">_animCount</a>
89 <code>- private int</code>
90 </h4>
91 <div class="detail">
92 <div class="description">
93 The current number of animations that are executing
94 </div>
95 </div>
100 <hr />
101 <h4><a name="_collapseAnim">_collapseAnim</a>
102 <code>- private string</code>
103 </h4>
104 <div class="detail">
105 <div class="description">
106 The animation to use for collapsing children, if any
107 </div>
108 </div>
113 <hr />
114 <h4><a name="_el">_el</a>
115 <code>- private object</code>
116 </h4>
117 <div class="detail">
118 <div class="description">
119 The host element for this tree
120 </div>
121 </div>
126 <hr />
127 <h4><a name="_expandAnim">_expandAnim</a>
128 <code>- private string</code>
129 </h4>
130 <div class="detail">
131 <div class="description">
132 The animation to use for expanding children, if any
133 </div>
134 </div>
139 <hr />
140 <h4><a name="_nodes">_nodes</a>
141 <code>- private Node[]</code>
142 </h4>
143 <div class="detail">
144 <div class="description">
145 Flat collection of all nodes in this tree. This is a sparse
146 array, so the length property can't be relied upon for a
147 node count for the tree.
148 </div>
149 </div>
154 <hr />
155 <h4><a name="id">id</a>
156 <code>- String</code>
157 </h4>
158 <div class="detail">
159 <div class="description">
160 The id of tree container element
161 </div>
162 </div>
167 <hr />
168 <h4><a name="locked">locked</a>
169 <code>- boolean</code>
170 </h4>
171 <div class="detail">
172 <div class="description">
173 We lock the tree control while waiting for the dynamic loader to return
174 </div>
175 </div>
180 <hr />
181 <h4><a name="maxAnim">maxAnim</a>
182 <code>- int</code>
183 </h4>
184 <div class="detail">
185 <div class="description">
186 The maximum number of animations to run at one time.
187 </div>
188 </div>
193 <hr />
194 <h4><a name="YAHOO.widget.TreeView.counter">YAHOO.widget.TreeView.counter</a>
195 <code>- private static object</code>
196 </h4>
197 <div class="detail">
198 <div class="description">
199 Counter for generating a new unique element id
200 </div>
201 </div>
206 <hr />
207 <h4><a name="YAHOO.widget.TreeView.nodeCount">YAHOO.widget.TreeView.nodeCount</a>
208 <code>- static int</code>
209 </h4>
210 <div class="detail">
211 <div class="description">
212 Running count of all nodes created in all trees. This is
213 used to provide unique identifies for all nodes. Deleting
214 nodes does not change the nodeCount.
215 </div>
216 </div>
221 <hr />
222 <h4><a name="YAHOO.widget.TreeView.trees">YAHOO.widget.TreeView.trees</a>
223 <code>- private static Array</code>
224 </h4>
225 <div class="detail">
226 <div class="description">
227 Global cache of tree instances
228 </div>
229 </div>
234 <hr />
237 </div>
238 </div>
240 <div class="section field inheritance">
241 <h4>Properties inherited from <a href="YAHOO.util.EventProvider.html">YAHOO.util.EventProvider</a>:</h4>
242 <div class="content">
243 <code>
245 <a href="YAHOO.util.EventProvider.html#__yui_events">__yui_events</a>,
246 <a href="YAHOO.util.EventProvider.html#__yui_subscribers">__yui_subscribers</a>
247 </code>
248 </div>
249 </div>
251 <div class="section method details">
252 <h3><a name="methodDetails">Methods</a></h3>
253 <div class="content">
254 <h4>
255 <a name="_deleteNode">_deleteNode</a></h4>
256 <div class="detail">
257 <code>
258 private
261 void
262 <strong>_deleteNode</strong>
265 </code>
267 <div class="description">
268 Deletes the node and recurses children
269 </div>
271 <div class="description">
274 <dl>
275 <dt>Returns:
276 <code>
277 void
278 </code></dt>
279 <dd></dd>
280 </dl>
282 </div>
284 </div>
285 <hr />
286 <h4>
287 <a name="animateCollapse">animateCollapse</a></h4>
288 <div class="detail">
289 <code>
293 boolean
294 <strong>animateCollapse</strong>
302 node
306 </code>
308 <div class="description">
309 Perform the collapse animation if configured, or just show the
310 element if not configured or too many animations are in progress
311 </div>
313 <div class="description">
315 <dl>
316 <dt>Parameters:</dt>
317 <dd>
318 <code>el &lt;HTMLElement&gt;</code>
319 the element to animate
320 </dd>
321 <dd>
322 <code>node &lt;YAHOO.util.Node&gt;</code>
323 the node that was expanded
324 </dd>
325 </dl>
327 <dl>
328 <dt>Returns:
329 <code>
330 boolean
331 </code></dt>
332 <dd>true if animation could be invoked, false otherwise</dd>
333 </dl>
335 </div>
337 </div>
338 <hr />
339 <h4>
340 <a name="animateExpand">animateExpand</a></h4>
341 <div class="detail">
342 <code>
346 boolean
347 <strong>animateExpand</strong>
355 node
359 </code>
361 <div class="description">
362 Perform the expand animation if configured, or just show the
363 element if not configured or too many animations are in progress
364 </div>
366 <div class="description">
368 <dl>
369 <dt>Parameters:</dt>
370 <dd>
371 <code>el &lt;HTMLElement&gt;</code>
372 the element to animate
373 </dd>
374 <dd>
375 <code>node &lt;YAHOO.util.Node&gt;</code>
376 the node that was expanded
377 </dd>
378 </dl>
380 <dl>
381 <dt>Returns:
382 <code>
383 boolean
384 </code></dt>
385 <dd>true if animation could be invoked, false otherwise</dd>
386 </dl>
388 </div>
390 </div>
391 <hr />
392 <h4>
393 <a name="collapseAll">collapseAll</a></h4>
394 <div class="detail">
395 <code>
399 void
400 <strong>collapseAll</strong>
403 </code>
405 <div class="description">
406 Collapses all expanded child nodes in the entire tree.
407 </div>
409 <div class="description">
412 <dl>
413 <dt>Returns:
414 <code>
415 void
416 </code></dt>
417 <dd></dd>
418 </dl>
420 </div>
422 </div>
423 <hr />
424 <h4>
425 <a name="collapseComplete">collapseComplete</a></h4>
426 <div class="detail">
427 <code>
431 void
432 <strong>collapseComplete</strong>
435 </code>
437 <div class="description">
438 Function executed when the collapse animation completes
439 </div>
441 <div class="description">
444 <dl>
445 <dt>Returns:
446 <code>
447 void
448 </code></dt>
449 <dd></dd>
450 </dl>
452 </div>
454 </div>
455 <hr />
456 <h4>
457 <a name="draw">draw</a></h4>
458 <div class="detail">
459 <code>
463 void
464 <strong>draw</strong>
467 </code>
469 <div class="description">
470 Renders the tree boilerplate and visible nodes
471 </div>
473 <div class="description">
476 <dl>
477 <dt>Returns:
478 <code>
479 void
480 </code></dt>
481 <dd></dd>
482 </dl>
484 </div>
486 </div>
487 <hr />
488 <h4>
489 <a name="expandAll">expandAll</a></h4>
490 <div class="detail">
491 <code>
495 void
496 <strong>expandAll</strong>
499 </code>
501 <div class="description">
502 Expands all child nodes. Note: this conflicts with the "multiExpand"
503 node property. If expand all is called in a tree with nodes that
504 do not allow multiple siblings to be displayed, only the last sibling
505 will be expanded.
506 </div>
508 <div class="description">
511 <dl>
512 <dt>Returns:
513 <code>
514 void
515 </code></dt>
516 <dd></dd>
517 </dl>
519 </div>
521 </div>
522 <hr />
523 <h4>
524 <a name="expandComplete">expandComplete</a></h4>
525 <div class="detail">
526 <code>
530 void
531 <strong>expandComplete</strong>
534 </code>
536 <div class="description">
537 Function executed when the expand animation completes
538 </div>
540 <div class="description">
543 <dl>
544 <dt>Returns:
545 <code>
546 void
547 </code></dt>
548 <dd></dd>
549 </dl>
551 </div>
553 </div>
554 <hr />
555 <h4>
556 <a name="generateId">generateId</a></h4>
557 <div class="detail">
558 <code>
559 private
562 void
563 <strong>generateId</strong>
566 </code>
568 <div class="description">
569 Generates an unique id for an element if it doesn't yet have one
570 </div>
572 <div class="description">
575 <dl>
576 <dt>Returns:
577 <code>
578 void
579 </code></dt>
580 <dd></dd>
581 </dl>
583 </div>
585 </div>
586 <hr />
587 <h4>
588 <a name="getEl">getEl</a></h4>
589 <div class="detail">
590 <code>
594 HTMLElement
595 <strong>getEl</strong>
598 </code>
600 <div class="description">
601 Returns the tree's host element
602 </div>
604 <div class="description">
607 <dl>
608 <dt>Returns:
609 <code>
610 HTMLElement
611 </code></dt>
612 <dd>the host element</dd>
613 </dl>
615 </div>
617 </div>
618 <hr />
619 <h4>
620 <a name="getNodeByIndex">getNodeByIndex</a></h4>
621 <div class="detail">
622 <code>
626 Node
627 <strong>getNodeByIndex</strong>
631 nodeIndex
635 </code>
637 <div class="description">
638 Returns a node in the tree that has the specified index (this index
639 is created internally, so this function probably will only be used
640 in html generated for a given node.)
641 </div>
643 <div class="description">
645 <dl>
646 <dt>Parameters:</dt>
647 <dd>
648 <code>nodeIndex &lt;int&gt;</code>
649 the index of the node wanted
650 </dd>
651 </dl>
653 <dl>
654 <dt>Returns:
655 <code>
656 Node
657 </code></dt>
658 <dd>the node with index=nodeIndex, null if no match</dd>
659 </dl>
661 </div>
663 </div>
664 <hr />
665 <h4>
666 <a name="getNodeByProperty">getNodeByProperty</a></h4>
667 <div class="detail">
668 <code>
672 Node
673 <strong>getNodeByProperty</strong>
677 property
681 value
685 </code>
687 <div class="description">
688 Returns a node that has a matching property and value in the data
689 object that was passed into its constructor.
690 </div>
692 <div class="description">
694 <dl>
695 <dt>Parameters:</dt>
696 <dd>
697 <code>property &lt;object&gt;</code>
698 the property to search (usually a string)
699 </dd>
700 <dd>
701 <code>value &lt;object&gt;</code>
702 the value we want to find (usuall an int or string)
703 </dd>
704 </dl>
706 <dl>
707 <dt>Returns:
708 <code>
709 Node
710 </code></dt>
711 <dd>the matching node, null if no match</dd>
712 </dl>
714 </div>
716 </div>
717 <hr />
718 <h4>
719 <a name="getNodesByProperty">getNodesByProperty</a></h4>
720 <div class="detail">
721 <code>
725 Array
726 <strong>getNodesByProperty</strong>
730 property
734 value
738 </code>
740 <div class="description">
741 Returns a collection of nodes that have a matching property
742 and value in the data object that was passed into its constructor.
743 </div>
745 <div class="description">
747 <dl>
748 <dt>Parameters:</dt>
749 <dd>
750 <code>property &lt;object&gt;</code>
751 the property to search (usually a string)
752 </dd>
753 <dd>
754 <code>value &lt;object&gt;</code>
755 the value we want to find (usuall an int or string)
756 </dd>
757 </dl>
759 <dl>
760 <dt>Returns:
761 <code>
762 Array
763 </code></dt>
764 <dd>the matching collection of nodes, null if no match</dd>
765 </dl>
767 </div>
769 </div>
770 <hr />
771 <h4>
772 <a name="getRoot">getRoot</a></h4>
773 <div class="detail">
774 <code>
778 Node
779 <strong>getRoot</strong>
782 </code>
784 <div class="description">
785 Returns the root node of this tree
786 </div>
788 <div class="description">
791 <dl>
792 <dt>Returns:
793 <code>
794 Node
795 </code></dt>
796 <dd>the root node</dd>
797 </dl>
799 </div>
801 </div>
802 <hr />
803 <h4>
804 <a name="init">init</a></h4>
805 <div class="detail">
806 <code>
807 private
810 void
811 <strong>init</strong>
814 </code>
816 <div class="description">
817 Initializes the tree
818 </div>
820 <div class="description">
823 <dl>
824 <dt>Returns:
825 <code>
826 void
827 </code></dt>
828 <dd></dd>
829 </dl>
831 </div>
833 </div>
834 <hr />
835 <h4>
836 <a name="onCollapse">onCollapse</a></h4>
837 <div class="detail">
838 <code>
842 void
843 <strong>onCollapse</strong>
847 node
851 </code>
853 <div class="description">
854 Abstract method that is executed when a node is collapsed.
855 </div>
857 <div class="description">
859 <dl>
860 <dt>Parameters:</dt>
861 <dd>
862 <code>node &lt;Node&gt;</code>
863 the node that was collapsed.
864 </dd>
865 </dl>
867 <dl>
868 <dt>Returns:
869 <code>
870 void
871 </code></dt>
872 <dd></dd>
873 </dl>
875 <div class="deprecated">
876 <strong>Deprecated</strong> use treeobj.subscribe("collapse") instead
877 </div>
878 </div>
880 </div>
881 <hr />
882 <h4>
883 <a name="onExpand">onExpand</a></h4>
884 <div class="detail">
885 <code>
889 void
890 <strong>onExpand</strong>
894 node
898 </code>
900 <div class="description">
901 Abstract method that is executed when a node is expanded
902 </div>
904 <div class="description">
906 <dl>
907 <dt>Parameters:</dt>
908 <dd>
909 <code>node &lt;Node&gt;</code>
910 the node that was expanded
911 </dd>
912 </dl>
914 <dl>
915 <dt>Returns:
916 <code>
917 void
918 </code></dt>
919 <dd></dd>
920 </dl>
922 <div class="deprecated">
923 <strong>Deprecated</strong> use treeobj.subscribe("expand") instead
924 </div>
925 </div>
927 </div>
928 <hr />
929 <h4>
930 <a name="popNode">popNode</a></h4>
931 <div class="detail">
932 <code>
936 void
937 <strong>popNode</strong>
945 </code>
947 <div class="description">
948 Removes the node from the tree, preserving the child collection
949 to make it possible to insert the branch into another part of the
950 tree, or another tree.
951 </div>
953 <div class="description">
955 <dl>
956 <dt>Parameters:</dt>
957 <dd>
958 <code>the &lt;Node&gt;</code>
959 node to remove
960 </dd>
961 </dl>
963 <dl>
964 <dt>Returns:
965 <code>
966 void
967 </code></dt>
968 <dd></dd>
969 </dl>
971 </div>
973 </div>
974 <hr />
975 <h4>
976 <a name="regNode">regNode</a></h4>
977 <div class="detail">
978 <code>
979 private
982 void
983 <strong>regNode</strong>
987 node
991 </code>
993 <div class="description">
994 Nodes register themselves with the tree instance when they are created.
995 </div>
997 <div class="description">
999 <dl>
1000 <dt>Parameters:</dt>
1001 <dd>
1002 <code>node &lt;Node&gt;</code>
1003 the node to register
1004 </dd>
1005 </dl>
1007 <dl>
1008 <dt>Returns:
1009 <code>
1010 void
1011 </code></dt>
1012 <dd></dd>
1013 </dl>
1015 </div>
1017 </div>
1018 <hr />
1019 <h4>
1020 <a name="removeChildren">removeChildren</a></h4>
1021 <div class="detail">
1022 <code>
1026 void
1027 <strong>removeChildren</strong>
1031 node
1035 </code>
1037 <div class="description">
1038 Deletes this nodes child collection, recursively. Also collapses
1039 the node, and resets the dynamic load flag. The primary use for
1040 this method is to purge a node and allow it to fetch its data
1041 dynamically again.
1042 </div>
1044 <div class="description">
1046 <dl>
1047 <dt>Parameters:</dt>
1048 <dd>
1049 <code>node &lt;Node&gt;</code>
1050 the node to purge
1051 </dd>
1052 </dl>
1054 <dl>
1055 <dt>Returns:
1056 <code>
1057 void
1058 </code></dt>
1059 <dd></dd>
1060 </dl>
1062 </div>
1064 </div>
1065 <hr />
1066 <h4>
1067 <a name="removeNode">removeNode</a></h4>
1068 <div class="detail">
1069 <code>
1073 boolean
1074 <strong>removeNode</strong>
1082 autoRefresh
1086 </code>
1088 <div class="description">
1089 Removes the node and its children, and optionally refreshes the
1090 branch of the tree that was affected.
1091 </div>
1093 <div class="description">
1095 <dl>
1096 <dt>Parameters:</dt>
1097 <dd>
1098 <code>The &lt;Node&gt;</code>
1099 node to remove
1100 </dd>
1101 <dd>
1102 <code>autoRefresh &lt;boolean&gt;</code>
1103 automatically refreshes branch if true
1104 </dd>
1105 </dl>
1107 <dl>
1108 <dt>Returns:
1109 <code>
1110 boolean
1111 </code></dt>
1112 <dd>False is there was a problem, true otherwise.</dd>
1113 </dl>
1115 </div>
1117 </div>
1118 <hr />
1119 <h4>
1120 <a name="setCollapseAnim">setCollapseAnim</a></h4>
1121 <div class="detail">
1122 <code>
1126 void
1127 <strong>setCollapseAnim</strong>
1135 </code>
1137 <div class="description">
1138 Sets up the animation for collapsing children
1139 </div>
1141 <div class="description">
1143 <dl>
1144 <dt>Parameters:</dt>
1145 <dd>
1146 <code>the &lt;string&gt;</code>
1147 type of animation (acceptable values defined in
1148 YAHOO.widget.TVAnim)
1149 </dd>
1150 </dl>
1152 <dl>
1153 <dt>Returns:
1154 <code>
1155 void
1156 </code></dt>
1157 <dd></dd>
1158 </dl>
1160 </div>
1162 </div>
1163 <hr />
1164 <h4>
1165 <a name="setDynamicLoad">setDynamicLoad</a></h4>
1166 <div class="detail">
1167 <code>
1171 void
1172 <strong>setDynamicLoad</strong>
1176 fnDataLoader
1180 iconMode
1184 </code>
1186 <div class="description">
1187 Configures this tree to dynamically load all child data
1188 </div>
1190 <div class="description">
1192 <dl>
1193 <dt>Parameters:</dt>
1194 <dd>
1195 <code>fnDataLoader &lt;function&gt;</code>
1196 the function that will be called to get the data
1197 </dd>
1198 <dd>
1199 <code>iconMode &lt;int&gt;</code>
1200 configures the icon that is displayed when a dynamic
1201 load node is expanded the first time without children. By default, the
1202 "collapse" icon will be used. If set to 1, the leaf node icon will be
1203 displayed.
1204 </dd>
1205 </dl>
1207 <dl>
1208 <dt>Returns:
1209 <code>
1210 void
1211 </code></dt>
1212 <dd></dd>
1213 </dl>
1215 </div>
1217 </div>
1218 <hr />
1219 <h4>
1220 <a name="setExpandAnim">setExpandAnim</a></h4>
1221 <div class="detail">
1222 <code>
1226 void
1227 <strong>setExpandAnim</strong>
1231 type
1235 </code>
1237 <div class="description">
1238 Sets up the animation for expanding children
1239 </div>
1241 <div class="description">
1243 <dl>
1244 <dt>Parameters:</dt>
1245 <dd>
1246 <code>type &lt;string&gt;</code>
1247 the type of animation (acceptable values defined
1248 in YAHOO.widget.TVAnim)
1249 </dd>
1250 </dl>
1252 <dl>
1253 <dt>Returns:
1254 <code>
1255 void
1256 </code></dt>
1257 <dd></dd>
1258 </dl>
1260 </div>
1262 </div>
1263 <hr />
1264 <h4>
1265 <a name="setUpLabel">setUpLabel</a></h4>
1266 <div class="detail">
1267 <code>
1271 void
1272 <strong>setUpLabel</strong>
1276 oData
1280 </code>
1282 <div class="description">
1283 Sets up the node label
1284 </div>
1286 <div class="description">
1288 <dl>
1289 <dt>Parameters:</dt>
1290 <dd>
1291 <code>oData &lt;object&gt;</code>
1292 string containing the label, or an object with a label property
1293 </dd>
1294 </dl>
1296 <dl>
1297 <dt>Returns:
1298 <code>
1299 void
1300 </code></dt>
1301 <dd></dd>
1302 </dl>
1304 </div>
1306 </div>
1307 <hr />
1308 <h4>
1309 <a name="toString">toString</a></h4>
1310 <div class="detail">
1311 <code>
1315 string
1316 <strong>toString</strong>
1319 </code>
1321 <div class="description">
1322 TreeView instance toString
1323 </div>
1325 <div class="description">
1328 <dl>
1329 <dt>Returns:
1330 <code>
1331 string
1332 </code></dt>
1333 <dd>string representation of the tree</dd>
1334 </dl>
1336 </div>
1338 </div>
1339 <hr />
1340 <h4>
1341 <a name="YAHOO.widget.TreeView.addHandler">YAHOO.widget.TreeView.addHandler</a></h4>
1342 <div class="detail">
1343 <code>
1345 static
1347 void
1348 <strong>YAHOO.widget.TreeView.addHandler</strong>
1356 sType
1364 </code>
1366 <div class="description">
1367 Add a DOM event
1368 </div>
1370 <div class="description">
1372 <dl>
1373 <dt>Parameters:</dt>
1374 <dd>
1375 <code>el &lt;object&gt;</code>
1376 the elment to bind the handler to
1377 </dd>
1378 <dd>
1379 <code>sType &lt;string&gt;</code>
1380 the type of event handler
1381 </dd>
1382 <dd>
1383 <code>fn &lt;function&gt;</code>
1384 the callback to invoke
1385 </dd>
1386 </dl>
1388 <dl>
1389 <dt>Returns:
1390 <code>
1391 void
1392 </code></dt>
1393 <dd></dd>
1394 </dl>
1396 </div>
1398 </div>
1399 <hr />
1400 <h4>
1401 <a name="YAHOO.widget.TreeView.getNode">YAHOO.widget.TreeView.getNode</a></h4>
1402 <div class="detail">
1403 <code>
1405 static
1407 Node
1408 <strong>YAHOO.widget.TreeView.getNode</strong>
1412 treeId
1416 nodeIndex
1420 </code>
1422 <div class="description">
1423 Global method for getting a node by its id. Used in the generated
1424 tree html.
1425 </div>
1427 <div class="description">
1429 <dl>
1430 <dt>Parameters:</dt>
1431 <dd>
1432 <code>treeId &lt;String&gt;</code>
1433 the id of the tree instance
1434 </dd>
1435 <dd>
1436 <code>nodeIndex &lt;String&gt;</code>
1437 the index of the node to return
1438 </dd>
1439 </dl>
1441 <dl>
1442 <dt>Returns:
1443 <code>
1444 Node
1445 </code></dt>
1446 <dd>the node instance requested, null if not found</dd>
1447 </dl>
1449 </div>
1451 </div>
1452 <hr />
1453 <h4>
1454 <a name="YAHOO.widget.TreeView.getTree">YAHOO.widget.TreeView.getTree</a></h4>
1455 <div class="detail">
1456 <code>
1458 static
1460 TreeView
1461 <strong>YAHOO.widget.TreeView.getTree</strong>
1465 treeId
1469 </code>
1471 <div class="description">
1472 Global method for getting a tree by its id. Used in the generated
1473 tree html.
1474 </div>
1476 <div class="description">
1478 <dl>
1479 <dt>Parameters:</dt>
1480 <dd>
1481 <code>treeId &lt;String&gt;</code>
1482 the id of the tree instance
1483 </dd>
1484 </dl>
1486 <dl>
1487 <dt>Returns:
1488 <code>
1489 TreeView
1490 </code></dt>
1491 <dd>the tree instance requested, null if not found.</dd>
1492 </dl>
1494 </div>
1496 </div>
1497 <hr />
1498 <h4>
1499 <a name="YAHOO.widget.TreeView.preload">YAHOO.widget.TreeView.preload</a></h4>
1500 <div class="detail">
1501 <code>
1503 static
1505 void
1506 <strong>YAHOO.widget.TreeView.preload</strong>
1510 prefix
1514 </code>
1516 <div class="description">
1517 Attempts to preload the images defined in the styles used to draw the tree by
1518 rendering off-screen elements that use the styles.
1519 </div>
1521 <div class="description">
1523 <dl>
1524 <dt>Parameters:</dt>
1525 <dd>
1526 <code>prefix &lt;string&gt;</code>
1527 the prefix to use to generate the names of the
1528 images to preload, default is ygtv
1529 </dd>
1530 </dl>
1532 <dl>
1533 <dt>Returns:
1534 <code>
1535 void
1536 </code></dt>
1537 <dd></dd>
1538 </dl>
1540 </div>
1542 </div>
1543 <hr />
1544 <h4>
1545 <a name="YAHOO.widget.TreeView.removeHandler">YAHOO.widget.TreeView.removeHandler</a></h4>
1546 <div class="detail">
1547 <code>
1549 static
1551 void
1552 <strong>YAHOO.widget.TreeView.removeHandler</strong>
1560 sType
1568 </code>
1570 <div class="description">
1571 Remove a DOM event
1572 </div>
1574 <div class="description">
1576 <dl>
1577 <dt>Parameters:</dt>
1578 <dd>
1579 <code>el &lt;object&gt;</code>
1580 the elment to bind the handler to
1581 </dd>
1582 <dd>
1583 <code>sType &lt;string&gt;</code>
1584 the type of event handler
1585 </dd>
1586 <dd>
1587 <code>fn &lt;function&gt;</code>
1588 the callback to invoke
1589 </dd>
1590 </dl>
1592 <dl>
1593 <dt>Returns:
1594 <code>
1595 void
1596 </code></dt>
1597 <dd></dd>
1598 </dl>
1600 </div>
1602 </div>
1603 <hr />
1604 </div>
1605 </div>
1607 <div class="section field inheritance">
1608 <h4>Methods inherited from <a href="YAHOO.util.EventProvider.html">YAHOO.util.EventProvider</a>:</h4>
1609 <div class="content">
1610 <code>
1612 <a href="YAHOO.util.EventProvider.html#createEvent">createEvent</a>,
1613 <a href="YAHOO.util.EventProvider.html#fireEvent">fireEvent</a>,
1614 <a href="YAHOO.util.EventProvider.html#hasEvent">hasEvent</a>,
1615 <a href="YAHOO.util.EventProvider.html#subscribe">subscribe</a>,
1616 <a href="YAHOO.util.EventProvider.html#unsubscribe">unsubscribe</a>,
1617 <a href="YAHOO.util.EventProvider.html#unsubscribeAll">unsubscribeAll</a>
1618 </code>
1619 </div>
1620 </div>
1622 <div class="section method details">
1623 <h3><a name="methodDetails">Events</a></h3>
1624 <div class="content">
1625 <h4>
1626 <a name="animComplete">animComplete</a></h4>
1627 <div class="detail">
1628 <code>
1632 <strong>animComplete</strong>
1637 node
1642 </code>
1644 <div class="description">
1645 When animation is enabled, this event fires when the animation
1646 completes
1647 </div>
1649 <div class="description">
1652 <dl>
1653 <dt>Parameters:</dt>
1654 <dd>
1655 <code>node &lt;YAHOO.widget.Node&gt;</code>
1656 the node that is expanding/collapsing
1657 </dd>
1658 </dl>
1661 </div>
1663 </div>
1664 <hr />
1665 <h4>
1666 <a name="animStart">animStart</a></h4>
1667 <div class="detail">
1668 <code>
1672 <strong>animStart</strong>
1677 node
1682 </code>
1684 <div class="description">
1685 When animation is enabled, this event fires when the animation
1686 starts
1687 </div>
1689 <div class="description">
1692 <dl>
1693 <dt>Parameters:</dt>
1694 <dd>
1695 <code>node &lt;YAHOO.widget.Node&gt;</code>
1696 the node that is expanding/collapsing
1697 </dd>
1698 </dl>
1701 </div>
1703 </div>
1704 <hr />
1705 <h4>
1706 <a name="collapse">collapse</a></h4>
1707 <div class="detail">
1708 <code>
1712 <strong>collapse</strong>
1717 node
1722 </code>
1724 <div class="description">
1725 Fires when a node is going to be collapsed. Return false to stop
1726 the collapse.
1727 </div>
1729 <div class="description">
1732 <dl>
1733 <dt>Parameters:</dt>
1734 <dd>
1735 <code>node &lt;YAHOO.widget.Node&gt;</code>
1736 the node that is collapsing
1737 </dd>
1738 </dl>
1741 </div>
1743 </div>
1744 <hr />
1745 <h4>
1746 <a name="collapseComplete">collapseComplete</a></h4>
1747 <div class="detail">
1748 <code>
1752 <strong>collapseComplete</strong>
1757 node
1762 </code>
1764 <div class="description">
1765 Fires after a node is successfully collapsed. This event will not fire
1766 if the "collapse" event was cancelled.
1767 </div>
1769 <div class="description">
1772 <dl>
1773 <dt>Parameters:</dt>
1774 <dd>
1775 <code>node &lt;YAHOO.widget.Node&gt;</code>
1776 the node that was collapsed
1777 </dd>
1778 </dl>
1781 </div>
1783 </div>
1784 <hr />
1785 <h4>
1786 <a name="expand">expand</a></h4>
1787 <div class="detail">
1788 <code>
1792 <strong>expand</strong>
1797 node
1802 </code>
1804 <div class="description">
1805 Fires when a node is going to be expanded. Return false to stop
1806 the collapse.
1807 </div>
1809 <div class="description">
1812 <dl>
1813 <dt>Parameters:</dt>
1814 <dd>
1815 <code>node &lt;YAHOO.widget.Node&gt;</code>
1816 the node that is expanding
1817 </dd>
1818 </dl>
1821 </div>
1823 </div>
1824 <hr />
1825 <h4>
1826 <a name="expandComplete">expandComplete</a></h4>
1827 <div class="detail">
1828 <code>
1832 <strong>expandComplete</strong>
1837 node
1842 </code>
1844 <div class="description">
1845 Fires after a node is successfully expanded. This event will not fire
1846 if the "expand" event was cancelled.
1847 </div>
1849 <div class="description">
1852 <dl>
1853 <dt>Parameters:</dt>
1854 <dd>
1855 <code>node &lt;YAHOO.widget.Node&gt;</code>
1856 the node that was expanded
1857 </dd>
1858 </dl>
1861 </div>
1863 </div>
1864 <hr />
1865 <h4>
1866 <a name="labelClick">labelClick</a></h4>
1867 <div class="detail">
1868 <code>
1872 <strong>labelClick</strong>
1877 node
1882 </code>
1884 <div class="description">
1885 Custom event that is fired when the text node label is clicked. The
1886 custom event is defined on the tree instance, so there is a single
1887 event that handles all nodes in the tree. The node clicked is
1888 provided as an argument
1889 </div>
1891 <div class="description">
1894 <dl>
1895 <dt>Parameters:</dt>
1896 <dd>
1897 <code>node &lt;YAHOO.widget.Node&gt;</code>
1898 the node clicked
1899 </dd>
1900 </dl>
1903 </div>
1905 </div>
1906 <hr />
1907 </div>
1908 </div>
1914 </div>
1915 </div>
1916 <div class="yui-b">
1917 <div class="nav">
1919 <div class="module">
1920 <h4>Modules</h4>
1921 <ul class="content">
1923 <li class=""><a href="module_animation.html">animation</a></li>
1925 <li class=""><a href="module_autocomplete.html">autocomplete</a></li>
1927 <li class=""><a href="module_button.html">button</a></li>
1929 <li class=""><a href="module_calendar.html">calendar</a></li>
1931 <li class=""><a href="module_connection.html">connection</a></li>
1933 <li class=""><a href="module_container.html">container</a></li>
1935 <li class=""><a href="module_datasource.html">datasource</a></li>
1937 <li class=""><a href="module_datatable.html">datatable</a></li>
1939 <li class=""><a href="module_dom.html">dom</a></li>
1941 <li class=""><a href="module_dragdrop.html">dragdrop</a></li>
1943 <li class=""><a href="module_element.html">element</a></li>
1945 <li class=""><a href="module_event.html">event</a></li>
1947 <li class=""><a href="module_history.html">history</a></li>
1949 <li class=""><a href="module_logger.html">logger</a></li>
1951 <li class=""><a href="module_menu.html">menu</a></li>
1953 <li class=""><a href="module_slider.html">slider</a></li>
1955 <li class=""><a href="module_tabview.html">tabview</a></li>
1957 <li class="selected"><a href="module_treeview.html">treeview</a></li>
1959 <li class=""><a href="module_yahoo.html">yahoo</a></li>
1960 </ul>
1961 </div>
1963 <div class="module">
1964 <h4>Classes</h4>
1965 <ul class="content">
1966 <li class=""><a href="YAHOO.widget.HTMLNode.html">YAHOO.widget.HTMLNode</a></li>
1967 <li class=""><a href="YAHOO.widget.MenuNode.html">YAHOO.widget.MenuNode</a></li>
1968 <li class=""><a href="YAHOO.widget.Node.html">YAHOO.widget.Node</a></li>
1969 <li class=""><a href="YAHOO.widget.RootNode.html">YAHOO.widget.RootNode</a></li>
1970 <li class=""><a href="YAHOO.widget.TextNode.html">YAHOO.widget.TextNode</a></li>
1971 <li class="selected"><a href="YAHOO.widget.TreeView.html">YAHOO.widget.TreeView</a></li>
1972 <li class=""><a href="YAHOO.widget.TVAnim.html">YAHOO.widget.TVAnim</a></li>
1973 <li class=""><a href="YAHOO.widget.TVFadeIn.html">YAHOO.widget.TVFadeIn</a></li>
1974 <li class=""><a href="YAHOO.widget.TVFadeOut.html">YAHOO.widget.TVFadeOut</a></li>
1975 </ul>
1976 </div>
1978 <div class="module">
1979 <h4>Files</h4>
1980 <ul class="content">
1981 <li class=""><a href="HTMLNode.js.html">HTMLNode.js</a></li>
1982 <li class=""><a href="MenuNode.js.html">MenuNode.js</a></li>
1983 <li class=""><a href="Node.js.html">Node.js</a></li>
1984 <li class=""><a href="RootNode.js.html">RootNode.js</a></li>
1985 <li class=""><a href="TextNode.js.html">TextNode.js</a></li>
1986 <li class=""><a href="TreeView.js.html">TreeView.js</a></li>
1987 <li class=""><a href="TVAnim.js.html">TVAnim.js</a></li>
1988 <li class=""><a href="TVFadeIn.js.html">TVFadeIn.js</a></li>
1989 <li class=""><a href="TVFadeOut.js.html">TVFadeOut.js</a></li>
1990 </ul>
1991 </div>
1993 <div class="module">
1994 <h4>Properties</h4>
1995 <ul class="content">
1996 <li><a href="#_animCount">_animCount</a>
1997 <!--<code>&lt;Array&gt;</code>-->
1998 </li>
1999 <li><a href="#_collapseAnim">_collapseAnim</a>
2000 <!--<code>&lt;Array&gt;</code>-->
2001 </li>
2002 <li><a href="#_el">_el</a>
2003 <!--<code>&lt;Array&gt;</code>-->
2004 </li>
2005 <li><a href="#_expandAnim">_expandAnim</a>
2006 <!--<code>&lt;Array&gt;</code>-->
2007 </li>
2008 <li><a href="#_nodes">_nodes</a>
2009 <!--<code>&lt;Array&gt;</code>-->
2010 </li>
2011 <li><a href="#id">id</a>
2012 <!--<code>&lt;Array&gt;</code>-->
2013 </li>
2014 <li><a href="#locked">locked</a>
2015 <!--<code>&lt;Array&gt;</code>-->
2016 </li>
2017 <li><a href="#maxAnim">maxAnim</a>
2018 <!--<code>&lt;Array&gt;</code>-->
2019 </li>
2020 <li><a href="#YAHOO.widget.TreeView.counter">YAHOO.widget.TreeView.counter</a>
2021 <!--<code>&lt;Array&gt;</code>-->
2022 </li>
2023 <li><a href="#YAHOO.widget.TreeView.nodeCount">YAHOO.widget.TreeView.nodeCount</a>
2024 <!--<code>&lt;Array&gt;</code>-->
2025 </li>
2026 <li><a href="#YAHOO.widget.TreeView.trees">YAHOO.widget.TreeView.trees</a>
2027 <!--<code>&lt;Array&gt;</code>-->
2028 </li>
2029 </ul>
2030 </div>
2032 <div class="module">
2033 <h4>Methods</h4>
2034 <ul class="content">
2035 <li><!--<code>void</code>-->
2036 <a href="#_deleteNode">_deleteNode</a>
2037 </li>
2038 <li><!--<code>boolean</code>-->
2039 <a href="#animateCollapse">animateCollapse</a>
2040 </li>
2041 <li><!--<code>boolean</code>-->
2042 <a href="#animateExpand">animateExpand</a>
2043 </li>
2044 <li><!--<code>void</code>-->
2045 <a href="#collapseAll">collapseAll</a>
2046 </li>
2047 <li><!--<code>void</code>-->
2048 <a href="#collapseComplete">collapseComplete</a>
2049 </li>
2050 <li><!--<code>void</code>-->
2051 <a href="#draw">draw</a>
2052 </li>
2053 <li><!--<code>void</code>-->
2054 <a href="#expandAll">expandAll</a>
2055 </li>
2056 <li><!--<code>void</code>-->
2057 <a href="#expandComplete">expandComplete</a>
2058 </li>
2059 <li><!--<code>void</code>-->
2060 <a href="#generateId">generateId</a>
2061 </li>
2062 <li><!--<code>HTMLElement</code>-->
2063 <a href="#getEl">getEl</a>
2064 </li>
2065 <li><!--<code>Node</code>-->
2066 <a href="#getNodeByIndex">getNodeByIndex</a>
2067 </li>
2068 <li><!--<code>Node</code>-->
2069 <a href="#getNodeByProperty">getNodeByProperty</a>
2070 </li>
2071 <li><!--<code>Array</code>-->
2072 <a href="#getNodesByProperty">getNodesByProperty</a>
2073 </li>
2074 <li><!--<code>Node</code>-->
2075 <a href="#getRoot">getRoot</a>
2076 </li>
2077 <li><!--<code>void</code>-->
2078 <a href="#init">init</a>
2079 </li>
2080 <li><!--<code>void</code>-->
2081 <a href="#onCollapse">onCollapse</a>
2082 </li>
2083 <li><!--<code>void</code>-->
2084 <a href="#onExpand">onExpand</a>
2085 </li>
2086 <li><!--<code>void</code>-->
2087 <a href="#popNode">popNode</a>
2088 </li>
2089 <li><!--<code>void</code>-->
2090 <a href="#regNode">regNode</a>
2091 </li>
2092 <li><!--<code>void</code>-->
2093 <a href="#removeChildren">removeChildren</a>
2094 </li>
2095 <li><!--<code>boolean</code>-->
2096 <a href="#removeNode">removeNode</a>
2097 </li>
2098 <li><!--<code>void</code>-->
2099 <a href="#setCollapseAnim">setCollapseAnim</a>
2100 </li>
2101 <li><!--<code>void</code>-->
2102 <a href="#setDynamicLoad">setDynamicLoad</a>
2103 </li>
2104 <li><!--<code>void</code>-->
2105 <a href="#setExpandAnim">setExpandAnim</a>
2106 </li>
2107 <li><!--<code>void</code>-->
2108 <a href="#setUpLabel">setUpLabel</a>
2109 </li>
2110 <li><!--<code>string</code>-->
2111 <a href="#toString">toString</a>
2112 </li>
2113 <li><!--<code>void</code>-->
2114 <a href="#YAHOO.widget.TreeView.addHandler">YAHOO.widget.TreeView.addHandler</a>
2115 </li>
2116 <li><!--<code>Node</code>-->
2117 <a href="#YAHOO.widget.TreeView.getNode">YAHOO.widget.TreeView.getNode</a>
2118 </li>
2119 <li><!--<code>TreeView</code>-->
2120 <a href="#YAHOO.widget.TreeView.getTree">YAHOO.widget.TreeView.getTree</a>
2121 </li>
2122 <li><!--<code>void</code>-->
2123 <a href="#YAHOO.widget.TreeView.preload">YAHOO.widget.TreeView.preload</a>
2124 </li>
2125 <li><!--<code>void</code>-->
2126 <a href="#YAHOO.widget.TreeView.removeHandler">YAHOO.widget.TreeView.removeHandler</a>
2127 </li>
2128 </ul>
2129 </div>
2131 <div class="module">
2132 <h4>Events</h4>
2133 <ul class="content">
2134 <li>
2135 <a href="#animComplete">animComplete</a>
2136 </li>
2137 <li>
2138 <a href="#animStart">animStart</a>
2139 </li>
2140 <li>
2141 <a href="#collapse">collapse</a>
2142 </li>
2143 <li>
2144 <a href="#collapseComplete">collapseComplete</a>
2145 </li>
2146 <li>
2147 <a href="#expand">expand</a>
2148 </li>
2149 <li>
2150 <a href="#expandComplete">expandComplete</a>
2151 </li>
2152 <li>
2153 <a href="#labelClick">labelClick</a>
2154 </li>
2155 </ul>
2156 </div>
2159 </div>
2160 </div>
2161 </div>
2162 <div id="ft">
2163 <hr />
2164 Copyright &copy; 2007 Yahoo! Inc. All rights reserved.
2165 </div>
2166 </div>
2167 </body>
2168 </html>