Partial Fix #5654 - roojspacker - get it working as a doc tool...
[roojs1] / docs2 / symbols / Roo.tree.TreeLoader.json
1 {
2   "name" : "Roo.tree.TreeLoader",
3   "augments" : [
4     "Roo.util.Observable"
5   ],
6   "desc" : "A TreeLoader provides for lazy loading of an {@link Roo.tree.TreeNode}'s child\nnodes from a specified URL. The response must be a javascript Array definition\nwho's elements are node definition objects. eg:\n<pre><code>\n{  success : true,\n   data :      [\n   \n    { 'id': 1, 'text': 'A folder Node', 'leaf': false },\n    { 'id': 2, 'text': 'A leaf Node', 'leaf': true }\n    ]\n}\n\n\n</code></pre>\n<br><br>\nThe old style respose with just an array is still supported, but not recommended.\n<br><br>\n\nA server request is sent, and child nodes are loaded only when a node is expanded.\nThe loading node's id is passed to the server under the parameter name \"node\" to\nenable the server to produce the correct child nodes.\n<br><br>\nTo pass extra parameters, an event handler may be attached to the \"beforeload\"\nevent, and the parameters specified in the TreeLoader's baseParams property:\n<pre><code>\n    myTreeLoader.on(\"beforeload\", function(treeLoader, node) {\n        this.baseParams.category = node.attributes.category;\n    }, this);\n</code></pre><\nThis would pass an HTTP parameter called \"category\" to the server containing\nthe value of the Node's \"category\" attribute.",
7   "isSingleton" : false,
8   "isStatic" : true,
9   "isBuiltin" : false,
10   "config" : [
11     {
12       "name" : "listeners",
13       "type" : "Object",
14       "desc" : "list of events and functions to call for this object, \nFor example :\n<pre><code>\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  </code></pre>",
15       "memberOf" : "Roo.util.Observable",
16       "values" : [
17       ]
18     },
19     {
20       "name" : "clearOnLoad",
21       "type" : "Boolean",
22       "desc" : "(optional) Default to true. Remove previously existing\nchild nodes before loading.",
23       "memberOf" : "Roo.tree.TreeLoader",
24       "values" : [
25       ]
26     },
27     {
28       "name" : "dataUrl",
29       "type" : "String",
30       "desc" : "The URL from which to request a Json string which\nspecifies an array of node definition object representing the child nodes\nto be loaded.",
31       "memberOf" : "Roo.tree.TreeLoader",
32       "values" : [
33       ]
34     },
35     {
36       "name" : "root",
37       "type" : "String",
38       "desc" : "(optional) Default to false. Use this to read data from an object \nproperty on loading, rather than expecting an array. (eg. more compatible to a standard\nGrid query { data : [ .....] }",
39       "memberOf" : "Roo.tree.TreeLoader",
40       "values" : [
41       ]
42     },
43     {
44       "name" : "requestMethod",
45       "type" : "String",
46       "desc" : "either GET or POST\ndefaults to POST (due to BC)\nto be loaded.",
47       "memberOf" : "Roo.tree.TreeLoader",
48       "values" : [
49       ]
50     },
51     {
52       "name" : "baseParams",
53       "type" : "Object",
54       "desc" : "(optional) An object containing properties which\nspecify HTTP parameters to be passed to each request for child nodes.",
55       "memberOf" : "Roo.tree.TreeLoader",
56       "values" : [
57       ]
58     },
59     {
60       "name" : "baseAttrs",
61       "type" : "Object",
62       "desc" : "(optional) An object containing attributes to be added to all nodes\ncreated by this loader. If the attributes sent by the server have an attribute in this object,\nthey take priority.",
63       "memberOf" : "Roo.tree.TreeLoader",
64       "values" : [
65       ]
66     },
67     {
68       "name" : "uiProviders",
69       "type" : "Object",
70       "desc" : "(optional) An object containing properties which\n\nDEPRECATED - use 'create' event handler to modify attributes - which affect creation.\nspecify custom {@link Roo.tree.TreeNodeUI} implementations. If the optional\n<i>uiProvider</i> attribute of a returned child node is a string rather\nthan a reference to a TreeNodeUI implementation, this that string value\nis used as a property name in the uiProviders object. You can define the provider named\n'default' , and this will be used for all nodes (if no uiProvider is delivered by the node data)",
71       "memberOf" : "Roo.tree.TreeLoader",
72       "values" : [
73       ]
74     },
75     {
76       "name" : "queryParam",
77       "type" : "String",
78       "desc" : "(optional) \nName of the query as it will be passed on the querystring (defaults to 'node')\neg. the request will be ?node=[id]",
79       "memberOf" : "Roo.tree.TreeLoader",
80       "values" : [
81       ]
82     }
83   ],
84   "methods" : [
85     {
86       "name" : "load",
87       "desc" : "Load an {@link Roo.tree.TreeNode} from the URL specified in the constructor.\nThis is called automatically when a node is expanded, but may be used to reload\na node (or append new children if the {@link #clearOnLoad} option is false.)",
88       "isStatic" : false,
89       "isConstructor" : false,
90       "isPrivate" : false,
91       "memberOf" : "Roo.tree.TreeLoader",
92       "example" : "",
93       "deprecated" : "",
94       "since" : "",
95       "see" : "",
96       "params" : [
97         {
98           "name" : "node",
99           "type" : "Roo.tree.TreeNode",
100           "desc" : "",
101           "isOptional" : false
102         },
103         {
104           "name" : "callback",
105           "type" : "Function",
106           "desc" : "",
107           "isOptional" : false
108         }
109       ],
110       "returns" : [
111       ]
112     },
113     {
114       "name" : "purgeListeners",
115       "desc" : "Removes all listeners for this object",
116       "isStatic" : false,
117       "isConstructor" : false,
118       "isPrivate" : false,
119       "memberOf" : "Roo.util.Observable",
120       "example" : "",
121       "deprecated" : "",
122       "since" : "",
123       "see" : "",
124       "params" : [
125       ],
126       "returns" : [
127       ]
128     },
129     {
130       "name" : "on",
131       "desc" : "Appends an event handler to this element (shorthand for addListener)",
132       "isStatic" : false,
133       "isConstructor" : false,
134       "isPrivate" : false,
135       "memberOf" : "Roo.util.Observable",
136       "example" : "",
137       "deprecated" : "",
138       "since" : "",
139       "see" : "",
140       "params" : [
141         {
142           "name" : "eventName",
143           "type" : "String",
144           "desc" : "The type of event to listen for",
145           "isOptional" : false
146         },
147         {
148           "name" : "handler",
149           "type" : "Function",
150           "desc" : "The method the event invokes",
151           "isOptional" : false
152         },
153         {
154           "name" : "scope",
155           "type" : "Object",
156           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
157           "isOptional" : false
158         },
159         {
160           "name" : "options",
161           "type" : "Object",
162           "desc" : "(optional)",
163           "isOptional" : false
164         }
165       ],
166       "returns" : [
167       ]
168     },
169     {
170       "name" : "un",
171       "desc" : "Removes a listener (shorthand for removeListener)",
172       "isStatic" : false,
173       "isConstructor" : false,
174       "isPrivate" : false,
175       "memberOf" : "Roo.util.Observable",
176       "example" : "",
177       "deprecated" : "",
178       "since" : "",
179       "see" : "",
180       "params" : [
181         {
182           "name" : "eventName",
183           "type" : "String",
184           "desc" : "The type of event to listen for",
185           "isOptional" : false
186         },
187         {
188           "name" : "handler",
189           "type" : "Function",
190           "desc" : "The handler to remove",
191           "isOptional" : false
192         },
193         {
194           "name" : "scope",
195           "type" : "Object",
196           "desc" : "(optional) The scope (this object) for the handler",
197           "isOptional" : false
198         }
199       ],
200       "returns" : [
201       ]
202     },
203     {
204       "name" : "addEvents",
205       "desc" : "Used to define events on this Observable",
206       "isStatic" : false,
207       "isConstructor" : false,
208       "isPrivate" : false,
209       "memberOf" : "Roo.util.Observable",
210       "example" : "",
211       "deprecated" : "",
212       "since" : "",
213       "see" : "",
214       "params" : [
215         {
216           "name" : "object",
217           "type" : "Object",
218           "desc" : "The object with the events defined",
219           "isOptional" : false
220         }
221       ],
222       "returns" : [
223       ]
224     },
225     {
226       "name" : "releaseCapture",
227       "desc" : "Removes <b>all</b> added captures from the Observable.",
228       "isStatic" : true,
229       "isConstructor" : false,
230       "isPrivate" : false,
231       "memberOf" : "Roo.util.Observable",
232       "example" : "",
233       "deprecated" : "",
234       "since" : "",
235       "see" : "",
236       "params" : [
237         {
238           "name" : "o",
239           "type" : "Observable",
240           "desc" : "The Observable to release",
241           "isOptional" : false
242         }
243       ],
244       "returns" : [
245       ]
246     },
247     {
248       "name" : "removeListener",
249       "desc" : "Removes a listener",
250       "isStatic" : false,
251       "isConstructor" : false,
252       "isPrivate" : false,
253       "memberOf" : "Roo.util.Observable",
254       "example" : "",
255       "deprecated" : "",
256       "since" : "",
257       "see" : "",
258       "params" : [
259         {
260           "name" : "eventName",
261           "type" : "String",
262           "desc" : "The type of event to listen for",
263           "isOptional" : false
264         },
265         {
266           "name" : "handler",
267           "type" : "Function",
268           "desc" : "The handler to remove",
269           "isOptional" : false
270         },
271         {
272           "name" : "scope",
273           "type" : "Object",
274           "desc" : "(optional) The scope (this object) for the handler",
275           "isOptional" : false
276         }
277       ],
278       "returns" : [
279       ]
280     },
281     {
282       "name" : "fireEvent",
283       "desc" : "Fires the specified event with the passed parameters (minus the event name).",
284       "isStatic" : false,
285       "isConstructor" : false,
286       "isPrivate" : false,
287       "memberOf" : "Roo.util.Observable",
288       "example" : "",
289       "deprecated" : "",
290       "since" : "",
291       "see" : "",
292       "params" : [
293         {
294           "name" : "eventName",
295           "type" : "String",
296           "desc" : "",
297           "isOptional" : false
298         },
299         {
300           "name" : "args",
301           "type" : "Object...",
302           "desc" : "Variable number of parameters are passed to handlers",
303           "isOptional" : false
304         }
305       ],
306       "returns" : [
307         {
308           "name" : "",
309           "type" : "Boolean",
310           "desc" : "returns false if any of the handlers return false otherwise it returns true"
311         }
312       ]
313     },
314     {
315       "name" : "hasListener",
316       "desc" : "Checks to see if this object has any listeners for a specified event",
317       "isStatic" : false,
318       "isConstructor" : false,
319       "isPrivate" : false,
320       "memberOf" : "Roo.util.Observable",
321       "example" : "",
322       "deprecated" : "",
323       "since" : "",
324       "see" : "",
325       "params" : [
326         {
327           "name" : "eventName",
328           "type" : "String",
329           "desc" : "The name of the event to check for",
330           "isOptional" : false
331         }
332       ],
333       "returns" : [
334         {
335           "name" : "",
336           "type" : "Boolean",
337           "desc" : "True if the event is being listened for, else false"
338         }
339       ]
340     },
341     {
342       "name" : "capture",
343       "desc" : "Starts capture on the specified Observable. All events will be passed\nto the supplied function with the event name + standard signature of the event\n<b>before</b> the event is fired. If the supplied function returns false,\nthe event will not fire.",
344       "isStatic" : true,
345       "isConstructor" : false,
346       "isPrivate" : false,
347       "memberOf" : "Roo.util.Observable",
348       "example" : "",
349       "deprecated" : "",
350       "since" : "",
351       "see" : "",
352       "params" : [
353         {
354           "name" : "o",
355           "type" : "Observable",
356           "desc" : "The Observable to capture",
357           "isOptional" : false
358         },
359         {
360           "name" : "fn",
361           "type" : "Function",
362           "desc" : "The function to call",
363           "isOptional" : false
364         },
365         {
366           "name" : "scope",
367           "type" : "Object",
368           "desc" : "(optional) The scope (this object) for the fn",
369           "isOptional" : false
370         }
371       ],
372       "returns" : [
373       ]
374     },
375     {
376       "name" : "addListener",
377       "desc" : "Appends an event handler to this component",
378       "isStatic" : false,
379       "isConstructor" : false,
380       "isPrivate" : false,
381       "memberOf" : "Roo.util.Observable",
382       "example" : "",
383       "deprecated" : "",
384       "since" : "",
385       "see" : "",
386       "params" : [
387         {
388           "name" : "eventName",
389           "type" : "String",
390           "desc" : "The type of event to listen for",
391           "isOptional" : false
392         },
393         {
394           "name" : "handler",
395           "type" : "Function",
396           "desc" : "The method the event invokes",
397           "isOptional" : false
398         },
399         {
400           "name" : "scope",
401           "type" : "Object",
402           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
403           "isOptional" : false
404         },
405         {
406           "name" : "options",
407           "type" : "Object",
408           "desc" : "(optional) An object containing handler configuration\nproperties. This may contain any of the following properties:<ul>\n<li>scope {Object} The scope in which to execute the handler function. The handler function's \"this\" context.</li>\n<li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li>\n<li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li>\n<li>buffer {Number} Causes the handler to be scheduled to run in an {@link Roo.util.DelayedTask} delayed\nby the specified number of milliseconds. If the event fires again within that time, the original\nhandler is <em>not</em> invoked, but the new handler is scheduled in its place.</li>\n</ul><br>\n<p>\n<b>Combining Options</b><br>\nUsing the options argument, it is possible to combine different types of listeners:<br>\n<br>\nA normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)\n\t\t<pre><code>\n\t\tel.on('click', this.onClick, this, {\n \t\t\tsingle: true,\n    \t\tdelay: 100,\n    \t\tforumId: 4\n\t\t});\n\t\t</code></pre>\n<p>\n<b>Attaching multiple handlers in 1 call</b><br>\nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple handlers.\n<pre><code>\n\t\tel.on({\n\t\t\t'click': {\n        \t\tfn: this.onClick,\n        \t\tscope: this,\n        \t\tdelay: 100\n    \t\t}, \n    \t\t'mouseover': {\n        \t\tfn: this.onMouseOver,\n        \t\tscope: this\n    \t\t},\n    \t\t'mouseout': {\n        \t\tfn: this.onMouseOut,\n        \t\tscope: this\n    \t\t}\n\t\t});\n\t\t</code></pre>\n<p>\nOr a shorthand syntax which passes the same scope object to all handlers:\n     \t<pre><code>\n\t\tel.on({\n\t\t\t'click': this.onClick,\n    \t\t'mouseover': this.onMouseOver,\n    \t\t'mouseout': this.onMouseOut,\n    \t\tscope: this\n\t\t});\n\t\t</code></pre>",
409           "isOptional" : false
410         }
411       ],
412       "returns" : [
413       ]
414     }
415   ],
416   "events" : [
417     {
418       "name" : "create",
419       "desc" : "Fires before a node is created, enabling you to return custom Node types",
420       "memberOf" : "",
421       "example" : "",
422       "deprecated" : "",
423       "since" : "",
424       "see" : "",
425       "params" : [
426         {
427           "name" : "This",
428           "type" : "Object",
429           "desc" : "TreeLoader object.",
430           "isOptional" : false
431         },
432         {
433           "name" : "attr",
434           "type" : "Object",
435           "desc" : "- the data returned from the AJAX call (modify it to suit)",
436           "isOptional" : false
437         }
438       ],
439       "returns" : [
440       ]
441     },
442     {
443       "name" : "beforeload",
444       "desc" : "Fires before a network request is made to retrieve the Json text which specifies a node's children.",
445       "memberOf" : "",
446       "example" : "",
447       "deprecated" : "",
448       "since" : "",
449       "see" : "",
450       "params" : [
451         {
452           "name" : "This",
453           "type" : "Object",
454           "desc" : "TreeLoader object.",
455           "isOptional" : false
456         },
457         {
458           "name" : "node",
459           "type" : "Object",
460           "desc" : "The {@link Roo.tree.TreeNode} object being loaded.",
461           "isOptional" : false
462         },
463         {
464           "name" : "callback",
465           "type" : "Object",
466           "desc" : "The callback function specified in the {@link #load} call.",
467           "isOptional" : false
468         }
469       ],
470       "returns" : [
471       ]
472     },
473     {
474       "name" : "load",
475       "desc" : "Fires when the node has been successfuly loaded.",
476       "memberOf" : "",
477       "example" : "",
478       "deprecated" : "",
479       "since" : "",
480       "see" : "",
481       "params" : [
482         {
483           "name" : "This",
484           "type" : "Object",
485           "desc" : "TreeLoader object.",
486           "isOptional" : false
487         },
488         {
489           "name" : "node",
490           "type" : "Object",
491           "desc" : "The {@link Roo.tree.TreeNode} object being loaded.",
492           "isOptional" : false
493         },
494         {
495           "name" : "response",
496           "type" : "Object",
497           "desc" : "The response object containing the data from the server.",
498           "isOptional" : false
499         }
500       ],
501       "returns" : [
502       ]
503     },
504     {
505       "name" : "loadexception",
506       "desc" : "Fires if the network request failed.",
507       "memberOf" : "",
508       "example" : "",
509       "deprecated" : "",
510       "since" : "",
511       "see" : "",
512       "params" : [
513         {
514           "name" : "This",
515           "type" : "Object",
516           "desc" : "TreeLoader object.",
517           "isOptional" : false
518         },
519         {
520           "name" : "node",
521           "type" : "Object",
522           "desc" : "The {@link Roo.tree.TreeNode} object being loaded.",
523           "isOptional" : false
524         },
525         {
526           "name" : "response",
527           "type" : "Object",
528           "desc" : "The response object containing the data from the server.",
529           "isOptional" : false
530         }
531       ],
532       "returns" : [
533       ]
534     }
535   ]
536 }