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