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