Fix #5665 - pre-commit hooks for roojs
[roojs1] / docs / symbols / Roo.UpdateManager.json
1 {
2   "name" : "Roo.UpdateManager",
3   "augments" : [
4     "Roo.util.Observable"
5   ],
6   "desc" : "Provides AJAX-style update for Element object.<br><br>\nUsage:<br>\n<pre><code>\n// Get it from a Roo.Element object\nvar el = Roo.get(\"foo\");\nvar mgr = el.getUpdateManager();\nmgr.update(\"http://myserver.com/index.php\", \"param1=1&amp;param2=2\");\n...\nmgr.formUpdate(\"myFormId\", \"http://myserver.com/index.php\");\n<br>\n// or directly (returns the same UpdateManager instance)\nvar mgr = new Roo.UpdateManager(\"myElementId\");\nmgr.startAutoRefresh(60, \"http://myserver.com/index.php\");\nmgr.on(\"update\", myFcnNeedsToKnow);\n<br>\n   // short handed call directly from the element object\n   Roo.get(\"foo\").load({\n        url: \"bar.php\",\n        scripts:true,\n        params: \"for=bar\",\n        text: \"Loading Foo...\"\n   });\n</code></pre>",
7   "isSingleton" : false,
8   "isStatic" : false,
9   "isBuiltin" : false,
10   "memberOf" : "UpdateManager",
11   "example" : "",
12   "deprecated" : "",
13   "since" : "",
14   "see" : "",
15   "params" : [
16     {
17       "name" : "el",
18       "type" : "String/HTMLElement/Roo.Element",
19       "desc" : "The element to update",
20       "isOptional" : false
21     },
22     {
23       "name" : "forceNew",
24       "type" : "Boolean",
25       "desc" : "(optional) By default the constructor checks to see if the passed element already has an UpdateManager and if it does it returns the same instance. This will skip that check (useful for extending this class).",
26       "isOptional" : false
27     }
28   ],
29   "returns" : [
30   ],
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       "values" : [
38       ]
39     }
40   ],
41   "methods" : [
42     {
43       "name" : "update",
44       "desc" : "Performs an async request, updating this element with the response. If params are specified it uses POST, otherwise it uses GET.",
45       "isStatic" : false,
46       "isConstructor" : false,
47       "isPrivate" : false,
48       "memberOf" : "Roo.UpdateManager",
49       "example" : "",
50       "deprecated" : "",
51       "since" : "",
52       "see" : "",
53       "params" : [
54         {
55           "name" : "url",
56           "type" : "Object/String/Function",
57           "desc" : "The url for this request or a function to call to get the url or a config object containing any of the following options:\n<pre><code>\num.update({<br/>\n    url: \"your-url.php\",<br/>\n    params: {param1: \"foo\", param2: \"bar\"}, // or a URL encoded string<br/>\n    callback: yourFunction,<br/>\n    scope: yourObject, //(optional scope)  <br/>\n    discardUrl: false, <br/>\n    nocache: false,<br/>\n    text: \"Loading...\",<br/>\n    timeout: 30,<br/>\n    scripts: false<br/>\n});\n</code></pre>\nThe only required property is url. The optional properties nocache, text and scripts\nare shorthand for disableCaching, indicatorText and loadScripts and are used to set their associated property on this UpdateManager instance.",
58           "isOptional" : false
59         },
60         {
61           "name" : "params",
62           "type" : "String/Object",
63           "desc" : "(optional) The parameters to pass as either a url encoded string \"param1=1&amp;param2=2\" or an object {param1: 1, param2: 2}",
64           "isOptional" : false
65         },
66         {
67           "name" : "callback",
68           "type" : "Function",
69           "desc" : "(optional) Callback when transaction is complete - called with signature (oElement, bSuccess, oResponse)",
70           "isOptional" : false
71         },
72         {
73           "name" : "discardUrl",
74           "type" : "Boolean",
75           "desc" : "(optional) By default when you execute an update the defaultUrl is changed to the last used url. If true, it will not store the url.",
76           "isOptional" : false
77         }
78       ],
79       "returns" : [
80       ]
81     },
82     {
83       "name" : "showLoading",
84       "desc" : "Called to update the element to \"Loading\" state. Override to perform custom action.",
85       "isStatic" : false,
86       "isConstructor" : false,
87       "isPrivate" : false,
88       "memberOf" : "Roo.UpdateManager",
89       "example" : "",
90       "deprecated" : "",
91       "since" : "",
92       "see" : "",
93       "params" : [
94       ],
95       "returns" : [
96       ]
97     },
98     {
99       "name" : "setDefaultUrl",
100       "desc" : "Set the defaultUrl used for updates",
101       "isStatic" : false,
102       "isConstructor" : false,
103       "isPrivate" : false,
104       "memberOf" : "Roo.UpdateManager",
105       "example" : "",
106       "deprecated" : "",
107       "since" : "",
108       "see" : "",
109       "params" : [
110         {
111           "name" : "defaultUrl",
112           "type" : "String/Function",
113           "desc" : "The url or a function to call to get the url",
114           "isOptional" : false
115         }
116       ],
117       "returns" : [
118       ]
119     },
120     {
121       "name" : "updateElement",
122       "desc" : "Static convenience method. This method is deprecated in favor of el.load({url:'foo.php', ...}).\nUsage:\n<pre><code>Roo.UpdateManager.updateElement(\"my-div\", \"stuff.php\");</code></pre>",
123       "isStatic" : true,
124       "isConstructor" : false,
125       "isPrivate" : false,
126       "memberOf" : "Roo.UpdateManager",
127       "example" : "",
128       "deprecated" : "This has been deprecated: ",
129       "since" : "",
130       "see" : "",
131       "params" : [
132         {
133           "name" : "el",
134           "type" : "String/HTMLElement/Roo.Element",
135           "desc" : "The element to update",
136           "isOptional" : false
137         },
138         {
139           "name" : "url",
140           "type" : "String",
141           "desc" : "The url",
142           "isOptional" : false
143         },
144         {
145           "name" : "params",
146           "type" : "String/Object",
147           "desc" : "(optional) Url encoded param string or an object of name/value pairs",
148           "isOptional" : false
149         },
150         {
151           "name" : "options",
152           "type" : "Object",
153           "desc" : "(optional) A config object with any of the UpdateManager properties you want to set - for example: {disableCaching:true, indicatorText: \"Loading data...\"}",
154           "isOptional" : false
155         }
156       ],
157       "returns" : [
158       ]
159     },
160     {
161       "name" : "refresh",
162       "desc" : "Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately",
163       "isStatic" : false,
164       "isConstructor" : false,
165       "isPrivate" : false,
166       "memberOf" : "Roo.UpdateManager",
167       "example" : "",
168       "deprecated" : "",
169       "since" : "",
170       "see" : "",
171       "params" : [
172         {
173           "name" : "callback",
174           "type" : "Function",
175           "desc" : "(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)",
176           "isOptional" : false
177         }
178       ],
179       "returns" : [
180       ]
181     },
182     {
183       "name" : "getEl",
184       "desc" : "Get the Element this UpdateManager is bound to",
185       "isStatic" : false,
186       "isConstructor" : false,
187       "isPrivate" : false,
188       "memberOf" : "Roo.UpdateManager",
189       "example" : "",
190       "deprecated" : "",
191       "since" : "",
192       "see" : "",
193       "params" : [
194       ],
195       "returns" : [
196         {
197           "name" : "",
198           "type" : "Roo.Element",
199           "desc" : "The element"
200         }
201       ]
202     },
203     {
204       "name" : "isUpdating",
205       "desc" : "Returns true if an update is in progress",
206       "isStatic" : false,
207       "isConstructor" : false,
208       "isPrivate" : false,
209       "memberOf" : "Roo.UpdateManager",
210       "example" : "",
211       "deprecated" : "",
212       "since" : "",
213       "see" : "",
214       "params" : [
215       ],
216       "returns" : [
217         {
218           "name" : "",
219           "type" : "Boolean",
220           "desc" : ""
221         }
222       ]
223     },
224     {
225       "name" : "stopAutoRefresh",
226       "desc" : "Stop auto refresh on this element.",
227       "isStatic" : false,
228       "isConstructor" : false,
229       "isPrivate" : false,
230       "memberOf" : "Roo.UpdateManager",
231       "example" : "",
232       "deprecated" : "",
233       "since" : "",
234       "see" : "",
235       "params" : [
236       ],
237       "returns" : [
238       ]
239     },
240     {
241       "name" : "startAutoRefresh",
242       "desc" : "Set this element to auto refresh.",
243       "isStatic" : false,
244       "isConstructor" : false,
245       "isPrivate" : false,
246       "memberOf" : "Roo.UpdateManager",
247       "example" : "",
248       "deprecated" : "",
249       "since" : "",
250       "see" : "",
251       "params" : [
252         {
253           "name" : "interval",
254           "type" : "Number",
255           "desc" : "How often to update (in seconds).",
256           "isOptional" : false
257         },
258         {
259           "name" : "url",
260           "type" : "String/Function",
261           "desc" : "(optional) The url for this request or a function to call to get the url (Defaults to the last used url)",
262           "isOptional" : false
263         },
264         {
265           "name" : "params",
266           "type" : "String/Object",
267           "desc" : "(optional) The parameters to pass as either a url encoded string \"&param1=1&param2=2\" or as an object {param1: 1, param2: 2}",
268           "isOptional" : false
269         },
270         {
271           "name" : "callback",
272           "type" : "Function",
273           "desc" : "(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)",
274           "isOptional" : false
275         },
276         {
277           "name" : "refreshNow",
278           "type" : "Boolean",
279           "desc" : "(optional) Whether to execute the refresh now, or wait the interval",
280           "isOptional" : false
281         }
282       ],
283       "returns" : [
284       ]
285     },
286     {
287       "name" : "abort",
288       "desc" : "Aborts the executing transaction",
289       "isStatic" : false,
290       "isConstructor" : false,
291       "isPrivate" : false,
292       "memberOf" : "Roo.UpdateManager",
293       "example" : "",
294       "deprecated" : "",
295       "since" : "",
296       "see" : "",
297       "params" : [
298       ],
299       "returns" : [
300       ]
301     },
302     {
303       "name" : "setRenderer",
304       "desc" : "Set the content renderer for this UpdateManager. See {@link Roo.UpdateManager.BasicRenderer#render} for more details.",
305       "isStatic" : false,
306       "isConstructor" : false,
307       "isPrivate" : false,
308       "memberOf" : "Roo.UpdateManager",
309       "example" : "",
310       "deprecated" : "",
311       "since" : "",
312       "see" : "",
313       "params" : [
314         {
315           "name" : "renderer",
316           "type" : "Object",
317           "desc" : "The object implementing the render() method",
318           "isOptional" : false
319         }
320       ],
321       "returns" : [
322       ]
323     },
324     {
325       "name" : "formUpdate",
326       "desc" : "Performs an async form post, updating this element with the response. If the form has the attribute enctype=\"multipart/form-data\", it assumes it's a file upload.\nUses this.sslBlankUrl for SSL file uploads to prevent IE security warning.",
327       "isStatic" : false,
328       "isConstructor" : false,
329       "isPrivate" : false,
330       "memberOf" : "Roo.UpdateManager",
331       "example" : "",
332       "deprecated" : "",
333       "since" : "",
334       "see" : "",
335       "params" : [
336         {
337           "name" : "form",
338           "type" : "String/HTMLElement",
339           "desc" : "The form Id or form element",
340           "isOptional" : false
341         },
342         {
343           "name" : "url",
344           "type" : "String",
345           "desc" : "(optional) The url to pass the form to. If omitted the action attribute on the form will be used.",
346           "isOptional" : false
347         },
348         {
349           "name" : "reset",
350           "type" : "Boolean",
351           "desc" : "(optional) Whether to try to reset the form after the update",
352           "isOptional" : false
353         },
354         {
355           "name" : "callback",
356           "type" : "Function",
357           "desc" : "(optional) Callback when transaction is complete - called with signature (oElement, bSuccess, oResponse)",
358           "isOptional" : false
359         }
360       ],
361       "returns" : [
362       ]
363     },
364     {
365       "name" : "purgeListeners",
366       "desc" : "Removes all listeners for this object",
367       "isStatic" : false,
368       "isConstructor" : false,
369       "isPrivate" : false,
370       "memberOf" : "Roo.util.Observable",
371       "example" : "",
372       "deprecated" : "",
373       "since" : "",
374       "see" : "",
375       "params" : [
376       ],
377       "returns" : [
378       ]
379     },
380     {
381       "name" : "on",
382       "desc" : "Appends an event handler to this element (shorthand for addListener)",
383       "isStatic" : false,
384       "isConstructor" : false,
385       "isPrivate" : false,
386       "memberOf" : "Roo.util.Observable",
387       "example" : "",
388       "deprecated" : "",
389       "since" : "",
390       "see" : "",
391       "params" : [
392         {
393           "name" : "eventName",
394           "type" : "String",
395           "desc" : "The type of event to listen for",
396           "isOptional" : false
397         },
398         {
399           "name" : "handler",
400           "type" : "Function",
401           "desc" : "The method the event invokes",
402           "isOptional" : false
403         },
404         {
405           "name" : "scope",
406           "type" : "Object",
407           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
408           "isOptional" : false
409         },
410         {
411           "name" : "options",
412           "type" : "Object",
413           "desc" : "(optional)",
414           "isOptional" : false
415         }
416       ],
417       "returns" : [
418       ]
419     },
420     {
421       "name" : "un",
422       "desc" : "Removes a listener (shorthand for removeListener)",
423       "isStatic" : false,
424       "isConstructor" : false,
425       "isPrivate" : false,
426       "memberOf" : "Roo.util.Observable",
427       "example" : "",
428       "deprecated" : "",
429       "since" : "",
430       "see" : "",
431       "params" : [
432         {
433           "name" : "eventName",
434           "type" : "String",
435           "desc" : "The type of event to listen for",
436           "isOptional" : false
437         },
438         {
439           "name" : "handler",
440           "type" : "Function",
441           "desc" : "The handler to remove",
442           "isOptional" : false
443         },
444         {
445           "name" : "scope",
446           "type" : "Object",
447           "desc" : "(optional) The scope (this object) for the handler",
448           "isOptional" : false
449         }
450       ],
451       "returns" : [
452       ]
453     },
454     {
455       "name" : "addEvents",
456       "desc" : "Used to define events on this Observable",
457       "isStatic" : false,
458       "isConstructor" : false,
459       "isPrivate" : false,
460       "memberOf" : "Roo.util.Observable",
461       "example" : "",
462       "deprecated" : "",
463       "since" : "",
464       "see" : "",
465       "params" : [
466         {
467           "name" : "object",
468           "type" : "Object",
469           "desc" : "The object with the events defined",
470           "isOptional" : false
471         }
472       ],
473       "returns" : [
474       ]
475     },
476     {
477       "name" : "releaseCapture",
478       "desc" : "Removes <b>all</b> added captures from the Observable.",
479       "isStatic" : true,
480       "isConstructor" : false,
481       "isPrivate" : false,
482       "memberOf" : "Roo.util.Observable",
483       "example" : "",
484       "deprecated" : "",
485       "since" : "",
486       "see" : "",
487       "params" : [
488         {
489           "name" : "o",
490           "type" : "Observable",
491           "desc" : "The Observable to release",
492           "isOptional" : false
493         }
494       ],
495       "returns" : [
496       ]
497     },
498     {
499       "name" : "removeListener",
500       "desc" : "Removes a listener",
501       "isStatic" : false,
502       "isConstructor" : false,
503       "isPrivate" : false,
504       "memberOf" : "Roo.util.Observable",
505       "example" : "",
506       "deprecated" : "",
507       "since" : "",
508       "see" : "",
509       "params" : [
510         {
511           "name" : "eventName",
512           "type" : "String",
513           "desc" : "The type of event to listen for",
514           "isOptional" : false
515         },
516         {
517           "name" : "handler",
518           "type" : "Function",
519           "desc" : "The handler to remove",
520           "isOptional" : false
521         },
522         {
523           "name" : "scope",
524           "type" : "Object",
525           "desc" : "(optional) The scope (this object) for the handler",
526           "isOptional" : false
527         }
528       ],
529       "returns" : [
530       ]
531     },
532     {
533       "name" : "fireEvent",
534       "desc" : "Fires the specified event with the passed parameters (minus the event name).",
535       "isStatic" : false,
536       "isConstructor" : false,
537       "isPrivate" : false,
538       "memberOf" : "Roo.util.Observable",
539       "example" : "",
540       "deprecated" : "",
541       "since" : "",
542       "see" : "",
543       "params" : [
544         {
545           "name" : "eventName",
546           "type" : "String",
547           "desc" : "",
548           "isOptional" : false
549         },
550         {
551           "name" : "args",
552           "type" : "Object...",
553           "desc" : "Variable number of parameters are passed to handlers",
554           "isOptional" : false
555         }
556       ],
557       "returns" : [
558         {
559           "name" : "",
560           "type" : "Boolean",
561           "desc" : "returns false if any of the handlers return false otherwise it returns true"
562         }
563       ]
564     },
565     {
566       "name" : "hasListener",
567       "desc" : "Checks to see if this object has any listeners for a specified event",
568       "isStatic" : false,
569       "isConstructor" : false,
570       "isPrivate" : false,
571       "memberOf" : "Roo.util.Observable",
572       "example" : "",
573       "deprecated" : "",
574       "since" : "",
575       "see" : "",
576       "params" : [
577         {
578           "name" : "eventName",
579           "type" : "String",
580           "desc" : "The name of the event to check for",
581           "isOptional" : false
582         }
583       ],
584       "returns" : [
585         {
586           "name" : "",
587           "type" : "Boolean",
588           "desc" : "True if the event is being listened for, else false"
589         }
590       ]
591     },
592     {
593       "name" : "capture",
594       "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.",
595       "isStatic" : true,
596       "isConstructor" : false,
597       "isPrivate" : false,
598       "memberOf" : "Roo.util.Observable",
599       "example" : "",
600       "deprecated" : "",
601       "since" : "",
602       "see" : "",
603       "params" : [
604         {
605           "name" : "o",
606           "type" : "Observable",
607           "desc" : "The Observable to capture",
608           "isOptional" : false
609         },
610         {
611           "name" : "fn",
612           "type" : "Function",
613           "desc" : "The function to call",
614           "isOptional" : false
615         },
616         {
617           "name" : "scope",
618           "type" : "Object",
619           "desc" : "(optional) The scope (this object) for the fn",
620           "isOptional" : false
621         }
622       ],
623       "returns" : [
624       ]
625     },
626     {
627       "name" : "addListener",
628       "desc" : "Appends an event handler to this component",
629       "isStatic" : false,
630       "isConstructor" : false,
631       "isPrivate" : false,
632       "memberOf" : "Roo.util.Observable",
633       "example" : "",
634       "deprecated" : "",
635       "since" : "",
636       "see" : "",
637       "params" : [
638         {
639           "name" : "eventName",
640           "type" : "String",
641           "desc" : "The type of event to listen for",
642           "isOptional" : false
643         },
644         {
645           "name" : "handler",
646           "type" : "Function",
647           "desc" : "The method the event invokes",
648           "isOptional" : false
649         },
650         {
651           "name" : "scope",
652           "type" : "Object",
653           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
654           "isOptional" : false
655         },
656         {
657           "name" : "options",
658           "type" : "Object",
659           "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>",
660           "isOptional" : false
661         }
662       ],
663       "returns" : [
664       ]
665     }
666   ],
667   "events" : [
668     {
669       "name" : "update",
670       "desc" : "Fired after successful update is made.",
671       "memberOf" : "Roo.UpdateManager",
672       "example" : "",
673       "deprecated" : "",
674       "since" : "",
675       "see" : "",
676       "params" : [
677         {
678           "name" : "el",
679           "type" : "Roo.Element",
680           "desc" : "",
681           "isOptional" : false
682         },
683         {
684           "name" : "oResponseObject",
685           "type" : "Object",
686           "desc" : "The response Object",
687           "isOptional" : false
688         }
689       ],
690       "returns" : [
691       ]
692     },
693     {
694       "name" : "beforeupdate",
695       "desc" : "Fired before an update is made, return false from your handler and the update is cancelled.",
696       "memberOf" : "Roo.UpdateManager",
697       "example" : "",
698       "deprecated" : "",
699       "since" : "",
700       "see" : "",
701       "params" : [
702         {
703           "name" : "el",
704           "type" : "Roo.Element",
705           "desc" : "",
706           "isOptional" : false
707         },
708         {
709           "name" : "url",
710           "type" : "String/Object/Function",
711           "desc" : "",
712           "isOptional" : false
713         },
714         {
715           "name" : "params",
716           "type" : "String/Object",
717           "desc" : "",
718           "isOptional" : false
719         }
720       ],
721       "returns" : [
722       ]
723     },
724     {
725       "name" : "failure",
726       "desc" : "Fired on update failure.",
727       "memberOf" : "Roo.UpdateManager",
728       "example" : "",
729       "deprecated" : "",
730       "since" : "",
731       "see" : "",
732       "params" : [
733         {
734           "name" : "el",
735           "type" : "Roo.Element",
736           "desc" : "",
737           "isOptional" : false
738         },
739         {
740           "name" : "oResponseObject",
741           "type" : "Object",
742           "desc" : "The response Object",
743           "isOptional" : false
744         }
745       ],
746       "returns" : [
747       ]
748     }
749   ]
750 }