Fix #6893 - fix roo docs
[roojs1] / docs / symbols / Roo.Ajax.json
1 {
2   "name" : "Roo.Ajax",
3   "augments" : [
4     "Roo.data.Connection",
5     "Roo.util.Observable"
6   ],
7   "desc" : "Global Ajax request class.",
8   "isSingleton" : false,
9   "isStatic" : false,
10   "isBuiltin" : false,
11   "memberOf" : "Ajax",
12   "example" : "",
13   "deprecated" : "",
14   "since" : "",
15   "see" : "",
16   "params" : [],
17   "returns" : [],
18   "config" : [
19     {
20       "name" : "listeners",
21       "type" : "Object",
22       "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>",
23       "memberOf" : "Roo.util.Observable",
24       "optvals" : []
25     },
26     {
27       "name" : "method",
28       "type" : "String",
29       "desc" : "(Optional)  The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET)",
30       "memberOf" : "Roo.Ajax",
31       "optvals" : []
32     },
33     {
34       "name" : "timeout",
35       "type" : "Number",
36       "desc" : "(Optional) The timeout in milliseconds to be used for requests. (defaults to 30000)",
37       "memberOf" : "Roo.Ajax",
38       "optvals" : []
39     },
40     {
41       "name" : "autoAbort",
42       "type" : "Boolean",
43       "desc" : "(Optional) Whether a new request should abort any pending requests. (defaults to false)",
44       "memberOf" : "Roo.Ajax",
45       "optvals" : []
46     },
47     {
48       "name" : "url",
49       "type" : "String",
50       "desc" : "The default URL to be used for requests to the server. (defaults to undefined)",
51       "memberOf" : "Roo.Ajax",
52       "optvals" : []
53     },
54     {
55       "name" : "extraParams",
56       "type" : "Object",
57       "desc" : "An object containing properties which are used as extra parameters to each request made by this object. (defaults to undefined)",
58       "memberOf" : "Roo.Ajax",
59       "optvals" : []
60     },
61     {
62       "name" : "disableCaching",
63       "type" : "Boolean",
64       "desc" : "(Optional)   True to add a unique cache-buster param to GET requests. (defaults to true)",
65       "memberOf" : "Roo.Ajax",
66       "optvals" : []
67     },
68     {
69       "name" : "defaultHeaders",
70       "type" : "Object",
71       "desc" : "An object containing request headers which are added to each request made by this object. (defaults to undefined)",
72       "memberOf" : "Roo.Ajax",
73       "optvals" : []
74     }
75   ],
76   "methods" : [
77     {
78       "name" : "isLoading",
79       "desc" : "Determine whether this object has a request outstanding.",
80       "isStatic" : false,
81       "isConstructor" : false,
82       "isPrivate" : false,
83       "memberOf" : "Roo.data.Connection",
84       "example" : "",
85       "deprecated" : "",
86       "since" : "",
87       "see" : "",
88       "params" : [
89         {
90           "name" : "transactionId",
91           "type" : "Number",
92           "desc" : "(Optional) defaults to the last transaction",
93           "isOptional" : false
94         }
95       ],
96       "returns" : [
97         {
98           "name" : "",
99           "type" : "Boolean",
100           "desc" : "True if there is an outstanding request."
101         }
102       ]
103     },
104     {
105       "name" : "request",
106       "desc" : "Sends an HTTP request to a remote server.",
107       "isStatic" : false,
108       "isConstructor" : false,
109       "isPrivate" : false,
110       "memberOf" : "Roo.data.Connection",
111       "example" : "",
112       "deprecated" : "",
113       "since" : "",
114       "see" : "",
115       "params" : [
116         {
117           "name" : "options",
118           "type" : "Object",
119           "desc" : "An object which may contain the following properties:<ul>\n<li><b>url</b> {String} (Optional) The URL to which to send the request. Defaults to configured URL</li>\n<li><b>params</b> {Object/String/Function} (Optional) An object containing properties which are used as parameters to the\nrequest, a url encoded string or a function to call to get either.</li>\n<li><b>method</b> {String} (Optional) The HTTP method to use for the request. Defaults to the configured method, or\nif no method was configured, \"GET\" if no parameters are being sent, and \"POST\" if parameters are being sent.</li>\n<li><b>callback</b> {Function} (Optional) The function to be called upon receipt of the HTTP response.\nThe callback is called regardless of success or failure and is passed the following parameters:<ul>\n<li>options {Object} The parameter to the request call.</li>\n<li>success {Boolean} True if the request succeeded.</li>\n<li>response {Object} The XMLHttpRequest object containing the response data.</li>\n</ul></li>\n<li><b>success</b> {Function} (Optional) The function to be called upon success of the request.\nThe callback is passed the following parameters:<ul>\n<li>response {Object} The XMLHttpRequest object containing the response data.</li>\n<li>options {Object} The parameter to the request call.</li>\n</ul></li>\n<li><b>failure</b> {Function} (Optional) The function to be called upon failure of the request.\nThe callback is passed the following parameters:<ul>\n<li>response {Object} The XMLHttpRequest object containing the response data.</li>\n<li>options {Object} The parameter to the request call.</li>\n</ul></li>\n<li><b>scope</b> {Object} (Optional) The scope in which to execute the callbacks: The \"this\" object\nfor the callback function. Defaults to the browser window.</li>\n<li><b>form</b> {Object/String} (Optional) A form object or id to pull parameters from.</li>\n<li><b>isUpload</b> {Boolean} (Optional) True if the form object is a file upload (will usually be automatically detected).</li>\n<li><b>headers</b> {Object} (Optional) Request headers to set for the request.</li>\n<li><b>xmlData</b> {Object} (Optional) XML document to use for the post. Note: This will be used instead of\nparams for the post data. Any params will be appended to the URL.</li>\n<li><b>disableCaching</b> {Boolean} (Optional) True to add a unique cache-buster param to GET requests.</li>\n</ul>",
120           "isOptional" : false
121         }
122       ],
123       "returns" : [
124         {
125           "name" : "",
126           "type" : "Number",
127           "desc" : "transactionId"
128         }
129       ]
130     },
131     {
132       "name" : "abort",
133       "desc" : "Aborts any outstanding request.",
134       "isStatic" : false,
135       "isConstructor" : false,
136       "isPrivate" : false,
137       "memberOf" : "Roo.data.Connection",
138       "example" : "",
139       "deprecated" : "",
140       "since" : "",
141       "see" : "",
142       "params" : [
143         {
144           "name" : "transactionId",
145           "type" : "Number",
146           "desc" : "(Optional) defaults to the last transaction",
147           "isOptional" : false
148         }
149       ],
150       "returns" : []
151     },
152     {
153       "name" : "purgeListeners",
154       "desc" : "Removes all listeners for this object",
155       "isStatic" : false,
156       "isConstructor" : false,
157       "isPrivate" : false,
158       "memberOf" : "Roo.util.Observable",
159       "example" : "",
160       "deprecated" : "",
161       "since" : "",
162       "see" : "",
163       "params" : [],
164       "returns" : []
165     },
166     {
167       "name" : "on",
168       "desc" : "Appends an event handler to this element (shorthand for addListener)",
169       "isStatic" : false,
170       "isConstructor" : false,
171       "isPrivate" : false,
172       "memberOf" : "Roo.util.Observable",
173       "example" : "",
174       "deprecated" : "",
175       "since" : "",
176       "see" : "",
177       "params" : [
178         {
179           "name" : "eventName",
180           "type" : "String",
181           "desc" : "The type of event to listen for",
182           "isOptional" : false
183         },
184         {
185           "name" : "handler",
186           "type" : "Function",
187           "desc" : "The method the event invokes",
188           "isOptional" : false
189         },
190         {
191           "name" : "scope",
192           "type" : "Object",
193           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
194           "isOptional" : false
195         },
196         {
197           "name" : "options",
198           "type" : "Object",
199           "desc" : "(optional)",
200           "isOptional" : false
201         }
202       ],
203       "returns" : []
204     },
205     {
206       "name" : "un",
207       "desc" : "Removes a listener (shorthand for removeListener)",
208       "isStatic" : false,
209       "isConstructor" : false,
210       "isPrivate" : false,
211       "memberOf" : "Roo.util.Observable",
212       "example" : "",
213       "deprecated" : "",
214       "since" : "",
215       "see" : "",
216       "params" : [
217         {
218           "name" : "eventName",
219           "type" : "String",
220           "desc" : "The type of event to listen for",
221           "isOptional" : false
222         },
223         {
224           "name" : "handler",
225           "type" : "Function",
226           "desc" : "The handler to remove",
227           "isOptional" : false
228         },
229         {
230           "name" : "scope",
231           "type" : "Object",
232           "desc" : "(optional) The scope (this object) for the handler",
233           "isOptional" : false
234         }
235       ],
236       "returns" : []
237     },
238     {
239       "name" : "addEvents",
240       "desc" : "Used to define events on this Observable",
241       "isStatic" : false,
242       "isConstructor" : false,
243       "isPrivate" : false,
244       "memberOf" : "Roo.util.Observable",
245       "example" : "",
246       "deprecated" : "",
247       "since" : "",
248       "see" : "",
249       "params" : [
250         {
251           "name" : "object",
252           "type" : "Object",
253           "desc" : "The object with the events defined",
254           "isOptional" : false
255         }
256       ],
257       "returns" : []
258     },
259     {
260       "name" : "releaseCapture",
261       "desc" : "Removes <b>all</b> added captures from the Observable.",
262       "isStatic" : true,
263       "isConstructor" : false,
264       "isPrivate" : false,
265       "memberOf" : "Roo.util.Observable",
266       "example" : "",
267       "deprecated" : "",
268       "since" : "",
269       "see" : "",
270       "params" : [
271         {
272           "name" : "o",
273           "type" : "Observable",
274           "desc" : "The Observable to release",
275           "isOptional" : false
276         }
277       ],
278       "returns" : []
279     },
280     {
281       "name" : "removeListener",
282       "desc" : "Removes a listener",
283       "isStatic" : false,
284       "isConstructor" : false,
285       "isPrivate" : false,
286       "memberOf" : "Roo.util.Observable",
287       "example" : "",
288       "deprecated" : "",
289       "since" : "",
290       "see" : "",
291       "params" : [
292         {
293           "name" : "eventName",
294           "type" : "String",
295           "desc" : "The type of event to listen for",
296           "isOptional" : false
297         },
298         {
299           "name" : "handler",
300           "type" : "Function",
301           "desc" : "The handler to remove",
302           "isOptional" : false
303         },
304         {
305           "name" : "scope",
306           "type" : "Object",
307           "desc" : "(optional) The scope (this object) for the handler",
308           "isOptional" : false
309         }
310       ],
311       "returns" : []
312     },
313     {
314       "name" : "fireEvent",
315       "desc" : "Fires the specified event with the passed parameters (minus the event name).",
316       "isStatic" : false,
317       "isConstructor" : false,
318       "isPrivate" : false,
319       "memberOf" : "Roo.util.Observable",
320       "example" : "",
321       "deprecated" : "",
322       "since" : "",
323       "see" : "",
324       "params" : [
325         {
326           "name" : "eventName",
327           "type" : "String",
328           "desc" : "",
329           "isOptional" : false
330         },
331         {
332           "name" : "args",
333           "type" : "Object...",
334           "desc" : "Variable number of parameters are passed to handlers",
335           "isOptional" : false
336         }
337       ],
338       "returns" : [
339         {
340           "name" : "",
341           "type" : "Boolean",
342           "desc" : "returns false if any of the handlers return false otherwise it returns true"
343         }
344       ]
345     },
346     {
347       "name" : "hasListener",
348       "desc" : "Checks to see if this object has any listeners for a specified event",
349       "isStatic" : false,
350       "isConstructor" : false,
351       "isPrivate" : false,
352       "memberOf" : "Roo.util.Observable",
353       "example" : "",
354       "deprecated" : "",
355       "since" : "",
356       "see" : "",
357       "params" : [
358         {
359           "name" : "eventName",
360           "type" : "String",
361           "desc" : "The name of the event to check for",
362           "isOptional" : false
363         }
364       ],
365       "returns" : [
366         {
367           "name" : "",
368           "type" : "Boolean",
369           "desc" : "True if the event is being listened for, else false"
370         }
371       ]
372     },
373     {
374       "name" : "capture",
375       "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.",
376       "isStatic" : true,
377       "isConstructor" : false,
378       "isPrivate" : false,
379       "memberOf" : "Roo.util.Observable",
380       "example" : "",
381       "deprecated" : "",
382       "since" : "",
383       "see" : "",
384       "params" : [
385         {
386           "name" : "o",
387           "type" : "Observable",
388           "desc" : "The Observable to capture",
389           "isOptional" : false
390         },
391         {
392           "name" : "fn",
393           "type" : "Function",
394           "desc" : "The function to call",
395           "isOptional" : false
396         },
397         {
398           "name" : "scope",
399           "type" : "Object",
400           "desc" : "(optional) The scope (this object) for the fn",
401           "isOptional" : false
402         }
403       ],
404       "returns" : []
405     },
406     {
407       "name" : "addListener",
408       "desc" : "Appends an event handler to this component",
409       "isStatic" : false,
410       "isConstructor" : false,
411       "isPrivate" : false,
412       "memberOf" : "Roo.util.Observable",
413       "example" : "",
414       "deprecated" : "",
415       "since" : "",
416       "see" : "",
417       "params" : [
418         {
419           "name" : "eventName",
420           "type" : "String",
421           "desc" : "The type of event to listen for",
422           "isOptional" : false
423         },
424         {
425           "name" : "handler",
426           "type" : "Function",
427           "desc" : "The method the event invokes",
428           "isOptional" : false
429         },
430         {
431           "name" : "scope",
432           "type" : "Object",
433           "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
434           "isOptional" : false
435         },
436         {
437           "name" : "options",
438           "type" : "Object",
439           "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>",
440           "isOptional" : false
441         }
442       ],
443       "returns" : []
444     }
445   ],
446   "events" : [
447     {
448       "name" : "requestcomplete",
449       "desc" : "Fires if the request was successfully completed.",
450       "memberOf" : "Roo.data.Connection",
451       "example" : "",
452       "deprecated" : "",
453       "since" : "",
454       "see" : "",
455       "params" : [
456         {
457           "name" : "conn",
458           "type" : "Connection",
459           "desc" : "This Connection object.",
460           "isOptional" : false
461         },
462         {
463           "name" : "response",
464           "type" : "Object",
465           "desc" : "The XHR object containing the response data.\nSee {@link http://www.w3.org/TR/XMLHttpRequest/} for details.",
466           "isOptional" : false
467         },
468         {
469           "name" : "options",
470           "type" : "Object",
471           "desc" : "The options config object passed to the {@link #request} method.",
472           "isOptional" : false
473         }
474       ],
475       "returns" : []
476     },
477     {
478       "name" : "beforerequest",
479       "desc" : "Fires before a network request is made to retrieve a data object.",
480       "memberOf" : "Roo.data.Connection",
481       "example" : "",
482       "deprecated" : "",
483       "since" : "",
484       "see" : "",
485       "params" : [
486         {
487           "name" : "conn",
488           "type" : "Connection",
489           "desc" : "This Connection object.",
490           "isOptional" : false
491         },
492         {
493           "name" : "options",
494           "type" : "Object",
495           "desc" : "The options config object passed to the {@link #request} method.",
496           "isOptional" : false
497         }
498       ],
499       "returns" : []
500     },
501     {
502       "name" : "requestexception",
503       "desc" : "Fires if an error HTTP status was returned from the server.\nSee {@link http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html} for details of HTTP status codes.",
504       "memberOf" : "Roo.data.Connection",
505       "example" : "",
506       "deprecated" : "",
507       "since" : "",
508       "see" : "",
509       "params" : [
510         {
511           "name" : "conn",
512           "type" : "Connection",
513           "desc" : "This Connection object.",
514           "isOptional" : false
515         },
516         {
517           "name" : "response",
518           "type" : "Object",
519           "desc" : "The XHR object containing the response data.\nSee {@link http://www.w3.org/TR/XMLHttpRequest/} for details.",
520           "isOptional" : false
521         },
522         {
523           "name" : "options",
524           "type" : "Object",
525           "desc" : "The options config object passed to the {@link #request} method.",
526           "isOptional" : false
527         }
528       ],
529       "returns" : []
530     }
531   ]
532 }