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