1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
---|
2 | |
---|
3 | <html> |
---|
4 | |
---|
5 | <head> |
---|
6 | <title>Destroydrop » Javascripts » Tree » Api</title> |
---|
7 | |
---|
8 | <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" /> |
---|
9 | <link rel="stylesheet" href="/dd.css" type="text/css" /> |
---|
10 | <link rel="shortcut icon" href="/favicon.ico" /> |
---|
11 | </head> |
---|
12 | |
---|
13 | <body> |
---|
14 | |
---|
15 | <div id="shadow"> |
---|
16 | |
---|
17 | <div id="content"> |
---|
18 | |
---|
19 | <div id="location"> |
---|
20 | <h1><a href="/">Destroydrop</a> » <a href="/javascripts/">Javascripts</a> » <a href="/javascripts/tree/">Tree</a> » <a href="/javascripts/tree/api/">Api</a></h1> |
---|
21 | </div> |
---|
22 | |
---|
23 | |
---|
24 | <div class="line"></div> |
---|
25 | |
---|
26 | <div id="files"> |
---|
27 | |
---|
28 | |
---|
29 | <h3>Overview</h3> |
---|
30 | <div class="line"></div> |
---|
31 | <div class="item"> |
---|
32 | |
---|
33 | <ul class="arrow"> |
---|
34 | <li><a href="#functions">Functions</a> |
---|
35 | <ul class="arrow"> |
---|
36 | <li><a href="#add">add</a></li> |
---|
37 | <li><a href="#openall">openAll</a></li> |
---|
38 | <li><a href="#closeall">closeAll</a></li> |
---|
39 | <li><a href="#opento">openTo</a></li> |
---|
40 | </ul> |
---|
41 | </li> |
---|
42 | <li><a href="#configuration">Configuration</a></li> |
---|
43 | </ul> |
---|
44 | |
---|
45 | </div> |
---|
46 | |
---|
47 | <a name="functions"></a> |
---|
48 | <h3>Functions</h3> |
---|
49 | <div class="line"></div> |
---|
50 | <div class="item"> |
---|
51 | |
---|
52 | <a name="add"></a> |
---|
53 | <h4 class="func">add()</h4> |
---|
54 | <p>Adds a node to the tree.<br />Can only be called before the tree is drawn.</p> |
---|
55 | <p>id, pid and name are required.</p> |
---|
56 | |
---|
57 | <h4>Parameters</h4> |
---|
58 | <table class="files"> |
---|
59 | <tr> |
---|
60 | <th>Name</th> |
---|
61 | <th>Type</th> |
---|
62 | <th>Description</th> |
---|
63 | </tr> |
---|
64 | <tr> |
---|
65 | <td>id</td> |
---|
66 | <td>Number</td> |
---|
67 | <td>Unique identity number.</td> |
---|
68 | </tr> |
---|
69 | <tr> |
---|
70 | <td>pid</td> |
---|
71 | <td>Number</td> |
---|
72 | <td>Number refering to the parent node. The value for the root node has to be -1.</td> |
---|
73 | </tr> |
---|
74 | <tr> |
---|
75 | <td>name</td> |
---|
76 | <td>String</td> |
---|
77 | <td>Text label for the node.</td> |
---|
78 | </tr> |
---|
79 | <tr> |
---|
80 | <td>url</td> |
---|
81 | <td>String</td> |
---|
82 | <td>Url for the node.</td> |
---|
83 | </tr> |
---|
84 | <tr> |
---|
85 | <td>title</td> |
---|
86 | <td>String</td> |
---|
87 | <td>Title for the node.</td> |
---|
88 | </tr> |
---|
89 | <tr> |
---|
90 | <td>target</td> |
---|
91 | <td>String</td> |
---|
92 | <td>Target for the node.</td> |
---|
93 | </tr> |
---|
94 | <tr> |
---|
95 | <td>icon</td> |
---|
96 | <td>String</td> |
---|
97 | <td>Image file to use as the icon. Uses default if not specified.</td> |
---|
98 | </tr> |
---|
99 | <tr> |
---|
100 | <td>iconOpen</td> |
---|
101 | <td>String</td> |
---|
102 | <td>Image file to use as the open icon. Uses default if not specified.</td> |
---|
103 | </tr> |
---|
104 | <tr> |
---|
105 | <td>open</td> |
---|
106 | <td>Boolean</td> |
---|
107 | <td>Is the node open.</td> |
---|
108 | </tr> |
---|
109 | </table> |
---|
110 | <br /> |
---|
111 | |
---|
112 | |
---|
113 | <h4>Example</h4> |
---|
114 | <p><code>mytree.add(1, 0, 'My node', 'node.html', 'node title', 'mainframe', 'img/musicfolder.gif');</code></p> |
---|
115 | <br /> |
---|
116 | |
---|
117 | <a name="openall"></a> |
---|
118 | <h4 class="func">openAll()</h4> |
---|
119 | <p>Opens all the nodes.<br />Can be called before and after the tree is drawn.</p> |
---|
120 | <h4>Example</h4> |
---|
121 | <p><code>mytree.openAll();</code></p> |
---|
122 | <br /> |
---|
123 | |
---|
124 | |
---|
125 | <a name="closeall"></a> |
---|
126 | <h4 class="func">closeAll()</h4> |
---|
127 | <p>Closes all the nodes.<br />Can be called before and after the tree is drawn.</p> |
---|
128 | <h4>Example</h4> |
---|
129 | <p><code>mytree.closeAll();</code></p> |
---|
130 | <br /> |
---|
131 | |
---|
132 | |
---|
133 | <a name="opento"></a> |
---|
134 | <h4 class="func">openTo()</h4> |
---|
135 | <p>Opens the tree to a certain node and can also select the node.<br /> |
---|
136 | Can only be called after the tree is drawn.</p> |
---|
137 | |
---|
138 | <h4>Parameters</h4> |
---|
139 | <table class="files"> |
---|
140 | <tr> |
---|
141 | <th>Name</th> |
---|
142 | <th>Type</th> |
---|
143 | <th>Description</th> |
---|
144 | </tr> |
---|
145 | <tr> |
---|
146 | <td>id</td> |
---|
147 | <td>Number</td> |
---|
148 | <td>Identity number for the node.</td> |
---|
149 | </tr> |
---|
150 | <tr> |
---|
151 | <td>select</td> |
---|
152 | <td>Boolean</td> |
---|
153 | <td>Should the node be selected.</td> |
---|
154 | </tr> |
---|
155 | </table> |
---|
156 | |
---|
157 | <h4>Example</h4> |
---|
158 | <p><code>mytree.openTo(4, true);</code></p> |
---|
159 | |
---|
160 | </div> |
---|
161 | |
---|
162 | <a name="configuration"></a> |
---|
163 | <h3>Configuration</h3> |
---|
164 | <div class="line"></div> |
---|
165 | <div class="item"> |
---|
166 | |
---|
167 | <table class="files"> |
---|
168 | <tr> |
---|
169 | <th>Variable</th> |
---|
170 | <th>Type</th> |
---|
171 | <th>Default</th> |
---|
172 | <th>Description</th> |
---|
173 | </tr> |
---|
174 | <tr> |
---|
175 | <td>target</td> |
---|
176 | <td>String</td> |
---|
177 | <td>true</td> |
---|
178 | <td>Target for all the nodes.</td> |
---|
179 | </tr> |
---|
180 | <tr> |
---|
181 | <td>folderLinks</td> |
---|
182 | <td>Boolean</td> |
---|
183 | <td>true</td> |
---|
184 | <td>Should folders be links.</td> |
---|
185 | </tr> |
---|
186 | <tr> |
---|
187 | <td>useSelection</td> |
---|
188 | <td>Boolean</td> |
---|
189 | <td>true</td> |
---|
190 | <td>Nodes can be selected(highlighted).</td> |
---|
191 | </tr> |
---|
192 | <tr> |
---|
193 | <td>useCookies</td> |
---|
194 | <td>Boolean</td> |
---|
195 | <td>true</td> |
---|
196 | <td>The tree uses cookies to rember it's state.</td> |
---|
197 | </tr> |
---|
198 | <tr> |
---|
199 | <td>useLines</td> |
---|
200 | <td>Boolean</td> |
---|
201 | <td>true</td> |
---|
202 | <td>Tree is drawn with lines.</td> |
---|
203 | </tr> |
---|
204 | <tr> |
---|
205 | <td>useIcons</td> |
---|
206 | <td>Boolean</td> |
---|
207 | <td>true</td> |
---|
208 | <td>Tree is drawn with icons.</td> |
---|
209 | </tr> |
---|
210 | <tr> |
---|
211 | <td>useStatusText</td> |
---|
212 | <td>Boolean</td> |
---|
213 | <td>false</td> |
---|
214 | <td>Displays node names in the statusbar instead of the url.</td> |
---|
215 | </tr> |
---|
216 | <tr> |
---|
217 | <td>closeSameLevel</td> |
---|
218 | <td>Boolean</td> |
---|
219 | <td>false</td> |
---|
220 | <td>Only one node within a parent can be expanded at the same time. openAll() and closeAll() functions do not work when this is enabled.</td> |
---|
221 | </tr> |
---|
222 | <tr> |
---|
223 | <td>inOrder</td> |
---|
224 | <td>Boolean</td> |
---|
225 | <td>false</td> |
---|
226 | <td>If parent nodes are always added before children, setting this to true speeds up the tree.</td> |
---|
227 | </tr> |
---|
228 | </table> |
---|
229 | |
---|
230 | <h4>Example</h4> |
---|
231 | <p><code>mytree.config.target = "mytarget";</code></p> |
---|
232 | |
---|
233 | </div> |
---|
234 | |
---|
235 | </div> |
---|
236 | |
---|
237 | <div class="line"></div> |
---|
238 | |
---|
239 | |
---|
240 | <div id="copy"> |
---|
241 | <p class="right"><a href="http://validator.w3.org/check/referer">XHTML</a>, <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></p> |
---|
242 | <p><a href="mailto:drop@destroydrop.com">©2002-2003 Geir Landrö</a></p> |
---|
243 | </div> |
---|
244 | |
---|
245 | </div> |
---|
246 | |
---|
247 | </div> |
---|
248 | |
---|
249 | |
---|
250 | </body> |
---|
251 | |
---|
252 | </html> |
---|