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