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