fix docs add optvalues
[roojs1] / docs / symbols / Roo.tree.TreeLoader.json
1 {
2   "name" : "Roo.tree.TreeLoader",
3   "augments" : [
4     "Roo.util.Observable"
5   ],
6   "childClasses" : {  },
7   "tree_children" : [],
8   "tree_parent" : [],
9   "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    \n</code></pre>\n\nThis would pass an HTTP parameter called \"category\" to the server containing\nthe value of the Node's \"category\" attribute.",
10   "isSingleton" : false,
11   "isStatic" : false,
12   "isBuiltin" : false,
13   "isAbstract" : false,
14   "isBuilderTop" : false,
15   "memberOf" : "TreeLoader",
16   "example" : "",
17   "deprecated" : "",
18   "since" : "",
19   "see" : "",
20   "params" : [
21     {
22       "name" : "config",
23       "type" : "Object",
24       "desc" : "A config object containing config properties.",
25       "isOptional" : false
26     }
27   ],
28   "returns" : [],
29   "throws" : "",
30   "requires" : "",
31   "config" : [
32     {
33       "name" : "listeners",
34       "type" : "Object",
35       "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>",
36       "memberOf" : "Roo.util.Observable",
37       "isOptional" : false,
38       "optvalues" : []
39     },
40     {
41       "name" : "clearOnLoad",
42       "type" : "Boolean",
43       "desc" : "(optional) Default to true. Remove previously existing\nchild nodes before loading.",
44       "memberOf" : "",
45       "isOptional" : false,
46       "optvalues" : []
47     },
48     {
49       "name" : "dataUrl",
50       "type" : "String",
51       "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.",
52       "memberOf" : "",
53       "isOptional" : false,
54       "optvalues" : []
55     },
56     {
57       "name" : "root",
58       "type" : "String",
59       "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 : [ .....] }",
60       "memberOf" : "",
61       "isOptional" : false,
62       "optvalues" : []
63     },
64     {
65       "name" : "requestMethod",
66       "type" : "String",
67       "desc" : "either GET or POST\ndefaults to POST (due to BC)\nto be loaded.",
68       "memberOf" : "",
69       "isOptional" : false,
70       "optvalues" : []
71     },
72     {
73       "name" : "baseParams",
74       "type" : "Object",
75       "desc" : "(optional) An object containing properties which\nspecify HTTP parameters to be passed to each request for child nodes.",
76       "memberOf" : "",
77       "isOptional" : false,
78       "optvalues" : []
79     },
80     {
81       "name" : "baseAttrs",
82       "type" : "Object",
83       "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.",
84       "memberOf" : "",
85       "isOptional" : false,
86       "optvalues" : []
87     },
88     {
89       "name" : "uiProviders",
90       "type" : "Object",
91       "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)",
92       "memberOf" : "",
93       "isOptional" : false,
94       "optvalues" : []
95     },
96     {
97       "name" : "queryParam",
98       "type" : "String",
99       "desc" : "(optional) \nName of the query as it will be passed on the querystring (defaults to 'node')\neg. the request will be ?node=[id]",
100       "memberOf" : "",
101       "isOptional" : false,
102       "optvalues" : []
103     }
104   ],
105   "methods" : [
106     {
107       "name" : "load",
108       "type" : "function",
109       "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.)",
110       "sig" : "(node, callback)",
111       "static" : false,
112       "memberOf" : "",
113       "isStatic" : false,
114       "isConstructor" : false,
115       "isPrivate" : false,
116       "example" : "",
117       "deprecated" : "",
118       "since" : "",
119       "see" : "",
120       "exceptions" : "",
121       "requires" : "",
122       "params" : [
123         {
124           "name" : "node",
125           "type" : "Roo.tree.TreeNode",
126           "desc" : "",
127           "isOptional" : false
128         },
129         {
130           "name" : "callback",
131           "type" : "Function",
132           "desc" : "",
133           "isOptional" : false
134         }
135       ],
136       "returns" : []
137     },
138     {
139       "name" : "purgeListeners",
140       "type" : "function",
141       "desc" : "Removes all listeners for this object",
142       "sig" : "()\n{\n\n}",
143       "static" : false,
144       "memberOf" : "Roo.util.Observable",
145       "isStatic" : false,
146       "isConstructor" : false,
147       "isPrivate" : false,
148       "example" : "",
149       "deprecated" : "",
150       "since" : "",
151       "see" : "",
152       "exceptions" : "",
153       "requires" : "",
154       "params" : [],
155       "returns" : []
156     },
157     {
158       "name" : "on",
159       "type" : "function",
160       "desc" : "Appends an event handler to this element (shorthand for addListener)",
161       "sig" : "(eventName, handler, scope, options)",
162       "static" : false,
163       "memberOf" : "Roo.util.Observable",
164       "isStatic" : false,
165       "isConstructor" : false,
166       "isPrivate" : false,
167       "example" : "",
168       "deprecated" : "",
169       "since" : "",
170       "see" : "",
171       "exceptions" : "",
172       "requires" : "",
173       "params" : [
174         {
175           "name" : "eventName",
176           "type" : "String",
177           "desc" : "The type of event to listen for",
178           "isOptional" : false
179         },
180         {
181           "name" : "handler",
182           "type" : "Function",
183           "desc" : "The method the event invokes",
184           "isOptional" : false
185         },
186         {
187           "name" : "scope",
188           "type" : "Object",
189           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
190           "isOptional" : false
191         },
192         {
193           "name" : "options",
194           "type" : "Object",
195           "desc" : "(optional)",
196           "isOptional" : false
197         }
198       ],
199       "returns" : []
200     },
201     {
202       "name" : "un",
203       "type" : "function",
204       "desc" : "Removes a listener (shorthand for removeListener)",
205       "sig" : "(eventName, handler, scope)",
206       "static" : false,
207       "memberOf" : "Roo.util.Observable",
208       "isStatic" : false,
209       "isConstructor" : false,
210       "isPrivate" : false,
211       "example" : "",
212       "deprecated" : "",
213       "since" : "",
214       "see" : "",
215       "exceptions" : "",
216       "requires" : "",
217       "params" : [
218         {
219           "name" : "eventName",
220           "type" : "String",
221           "desc" : "The type of event to listen for",
222           "isOptional" : false
223         },
224         {
225           "name" : "handler",
226           "type" : "Function",
227           "desc" : "The handler to remove",
228           "isOptional" : false
229         },
230         {
231           "name" : "scope",
232           "type" : "Object",
233           "desc" : "(optional) The scope (this object) for the handler",
234           "isOptional" : false
235         }
236       ],
237       "returns" : []
238     },
239     {
240       "name" : "addEvents",
241       "type" : "function",
242       "desc" : "Used to define events on this Observable",
243       "sig" : "(object)",
244       "static" : false,
245       "memberOf" : "Roo.util.Observable",
246       "isStatic" : false,
247       "isConstructor" : false,
248       "isPrivate" : false,
249       "example" : "",
250       "deprecated" : "",
251       "since" : "",
252       "see" : "",
253       "exceptions" : "",
254       "requires" : "",
255       "params" : [
256         {
257           "name" : "object",
258           "type" : "Object",
259           "desc" : "The object with the events defined",
260           "isOptional" : false
261         }
262       ],
263       "returns" : []
264     },
265     {
266       "name" : "releaseCapture",
267       "type" : "function",
268       "desc" : "Removes <b>all</b> added captures from the Observable.",
269       "sig" : "(o)",
270       "static" : true,
271       "memberOf" : "Roo.util.Observable",
272       "isStatic" : true,
273       "isConstructor" : false,
274       "isPrivate" : false,
275       "example" : "",
276       "deprecated" : "",
277       "since" : "",
278       "see" : "",
279       "exceptions" : "",
280       "requires" : "",
281       "params" : [
282         {
283           "name" : "o",
284           "type" : "Observable",
285           "desc" : "The Observable to release",
286           "isOptional" : false
287         }
288       ],
289       "returns" : []
290     },
291     {
292       "name" : "removeListener",
293       "type" : "function",
294       "desc" : "Removes a listener",
295       "sig" : "(eventName, handler, scope)",
296       "static" : false,
297       "memberOf" : "Roo.util.Observable",
298       "isStatic" : false,
299       "isConstructor" : false,
300       "isPrivate" : false,
301       "example" : "",
302       "deprecated" : "",
303       "since" : "",
304       "see" : "",
305       "exceptions" : "",
306       "requires" : "",
307       "params" : [
308         {
309           "name" : "eventName",
310           "type" : "String",
311           "desc" : "The type of event to listen for",
312           "isOptional" : false
313         },
314         {
315           "name" : "handler",
316           "type" : "Function",
317           "desc" : "The handler to remove",
318           "isOptional" : false
319         },
320         {
321           "name" : "scope",
322           "type" : "Object",
323           "desc" : "(optional) The scope (this object) for the handler",
324           "isOptional" : false
325         }
326       ],
327       "returns" : []
328     },
329     {
330       "name" : "fireEvent",
331       "type" : "function",
332       "desc" : "Fires the specified event with the passed parameters (minus the event name).",
333       "sig" : "(eventName, args)",
334       "static" : false,
335       "memberOf" : "Roo.util.Observable",
336       "isStatic" : false,
337       "isConstructor" : false,
338       "isPrivate" : false,
339       "example" : "",
340       "deprecated" : "",
341       "since" : "",
342       "see" : "",
343       "exceptions" : "",
344       "requires" : "",
345       "params" : [
346         {
347           "name" : "eventName",
348           "type" : "String",
349           "desc" : "",
350           "isOptional" : false
351         },
352         {
353           "name" : "args",
354           "type" : "Object...",
355           "desc" : "Variable number of parameters are passed to handlers",
356           "isOptional" : false
357         }
358       ],
359       "returns" : [
360         {
361           "name" : "",
362           "type" : "Boolean",
363           "desc" : "returns false if any of the handlers return false otherwise it returns true"
364         }
365       ]
366     },
367     {
368       "name" : "hasListener",
369       "type" : "function",
370       "desc" : "Checks to see if this object has any listeners for a specified event",
371       "sig" : "(eventName)",
372       "static" : false,
373       "memberOf" : "Roo.util.Observable",
374       "isStatic" : false,
375       "isConstructor" : false,
376       "isPrivate" : false,
377       "example" : "",
378       "deprecated" : "",
379       "since" : "",
380       "see" : "",
381       "exceptions" : "",
382       "requires" : "",
383       "params" : [
384         {
385           "name" : "eventName",
386           "type" : "String",
387           "desc" : "The name of the event to check for",
388           "isOptional" : false
389         }
390       ],
391       "returns" : [
392         {
393           "name" : "",
394           "type" : "Boolean",
395           "desc" : "True if the event is being listened for, else false"
396         }
397       ]
398     },
399     {
400       "name" : "capture",
401       "type" : "function",
402       "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.",
403       "sig" : "(o, fn, scope)",
404       "static" : true,
405       "memberOf" : "Roo.util.Observable",
406       "isStatic" : true,
407       "isConstructor" : false,
408       "isPrivate" : false,
409       "example" : "",
410       "deprecated" : "",
411       "since" : "",
412       "see" : "",
413       "exceptions" : "",
414       "requires" : "",
415       "params" : [
416         {
417           "name" : "o",
418           "type" : "Observable",
419           "desc" : "The Observable to capture",
420           "isOptional" : false
421         },
422         {
423           "name" : "fn",
424           "type" : "Function",
425           "desc" : "The function to call",
426           "isOptional" : false
427         },
428         {
429           "name" : "scope",
430           "type" : "Object",
431           "desc" : "(optional) The scope (this object) for the fn",
432           "isOptional" : false
433         }
434       ],
435       "returns" : []
436     },
437     {
438       "name" : "addListener",
439       "type" : "function",
440       "desc" : "Appends an event handler to this component",
441       "sig" : "(eventName, handler, scope, options)",
442       "static" : false,
443       "memberOf" : "Roo.util.Observable",
444       "isStatic" : false,
445       "isConstructor" : false,
446       "isPrivate" : false,
447       "example" : "",
448       "deprecated" : "",
449       "since" : "",
450       "see" : "",
451       "exceptions" : "",
452       "requires" : "",
453       "params" : [
454         {
455           "name" : "eventName",
456           "type" : "String",
457           "desc" : "The type of event to listen for",
458           "isOptional" : false
459         },
460         {
461           "name" : "handler",
462           "type" : "Function",
463           "desc" : "The method the event invokes",
464           "isOptional" : false
465         },
466         {
467           "name" : "scope",
468           "type" : "Object",
469           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
470           "isOptional" : false
471         },
472         {
473           "name" : "options",
474           "type" : "Object",
475           "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>",
476           "isOptional" : false
477         }
478       ],
479       "returns" : []
480     }
481   ],
482   "events" : [
483     {
484       "name" : "create",
485       "type" : "function",
486       "desc" : "Fires before a node is created, enabling you to return custom Node types",
487       "sig" : "function (This, attr)\n{\n\n}",
488       "memberOf" : "",
489       "example" : "",
490       "deprecated" : "",
491       "since" : "",
492       "see" : "",
493       "params" : [
494         {
495           "name" : "This",
496           "type" : "Object",
497           "desc" : "TreeLoader object.",
498           "isOptional" : false
499         },
500         {
501           "name" : "attr",
502           "type" : "Object",
503           "desc" : "- the data returned from the AJAX call (modify it to suit)",
504           "isOptional" : false
505         }
506       ],
507       "returns" : []
508     },
509     {
510       "name" : "beforeload",
511       "type" : "function",
512       "desc" : "Fires before a network request is made to retrieve the Json text which specifies a node's children.",
513       "sig" : "function (This, node, callback)\n{\n\n}",
514       "memberOf" : "",
515       "example" : "",
516       "deprecated" : "",
517       "since" : "",
518       "see" : "",
519       "params" : [
520         {
521           "name" : "This",
522           "type" : "Object",
523           "desc" : "TreeLoader object.",
524           "isOptional" : false
525         },
526         {
527           "name" : "node",
528           "type" : "Object",
529           "desc" : "The {@link Roo.tree.TreeNode} object being loaded.",
530           "isOptional" : false
531         },
532         {
533           "name" : "callback",
534           "type" : "Object",
535           "desc" : "The callback function specified in the {@link #load} call.",
536           "isOptional" : false
537         }
538       ],
539       "returns" : []
540     },
541     {
542       "name" : "load",
543       "type" : "function",
544       "desc" : "Fires when the node has been successfuly loaded.",
545       "sig" : "function (This, node, response)\n{\n\n}",
546       "memberOf" : "",
547       "example" : "",
548       "deprecated" : "",
549       "since" : "",
550       "see" : "",
551       "params" : [
552         {
553           "name" : "This",
554           "type" : "Object",
555           "desc" : "TreeLoader object.",
556           "isOptional" : false
557         },
558         {
559           "name" : "node",
560           "type" : "Object",
561           "desc" : "The {@link Roo.tree.TreeNode} object being loaded.",
562           "isOptional" : false
563         },
564         {
565           "name" : "response",
566           "type" : "Object",
567           "desc" : "The response object containing the data from the server.",
568           "isOptional" : false
569         }
570       ],
571       "returns" : []
572     },
573     {
574       "name" : "loadexception",
575       "type" : "function",
576       "desc" : "Fires if the network request failed.",
577       "sig" : "function (This, node, response)\n{\n\n}",
578       "memberOf" : "",
579       "example" : "",
580       "deprecated" : "",
581       "since" : "",
582       "see" : "",
583       "params" : [
584         {
585           "name" : "This",
586           "type" : "Object",
587           "desc" : "TreeLoader object.",
588           "isOptional" : false
589         },
590         {
591           "name" : "node",
592           "type" : "Object",
593           "desc" : "The {@link Roo.tree.TreeNode} object being loaded.",
594           "isOptional" : false
595         },
596         {
597           "name" : "response",
598           "type" : "Object",
599           "desc" : "The response object containing the data from the server.",
600           "isOptional" : false
601         }
602       ],
603       "returns" : []
604     }
605   ]
606 }