Upgrade to ExtJS 3.2.1 - Released 04/27/2010
[extjs.git] / docs / source / Connection.html
1 <html>
2 <head>
3   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    
4   <title>The source code</title>
5     <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6     <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 </head>
8 <body  onload="prettyPrint();">
9     <pre class="prettyprint lang-js">/*!
10  * Ext JS Library 3.2.1
11  * Copyright(c) 2006-2010 Ext JS, Inc.
12  * licensing@extjs.com
13  * http://www.extjs.com/license
14  */
15 (function(){
16     var BEFOREREQUEST = "beforerequest",
17         REQUESTCOMPLETE = "requestcomplete",
18         REQUESTEXCEPTION = "requestexception",
19         UNDEFINED = undefined,
20         LOAD = 'load',
21         POST = 'POST',
22         GET = 'GET',
23         WINDOW = window;
24
25     <div id="cls-Ext.data.Connection"></div>/**
26      * @class Ext.data.Connection
27      * @extends Ext.util.Observable
28      * <p>The class encapsulates a connection to the page's originating domain, allowing requests to be made
29      * either to a configured URL, or to a URL specified at request time.</p>
30      * <p>Requests made by this class are asynchronous, and will return immediately. No data from
31      * the server will be available to the statement immediately following the {@link #request} call.
32      * To process returned data, use a
33      * <a href="#request-option-success" ext:member="request-option-success" ext:cls="Ext.data.Connection">success callback</a>
34      * in the request options object,
35      * or an {@link #requestcomplete event listener}.</p>
36      * <p><h3>File Uploads</h3><a href="#request-option-isUpload" ext:member="request-option-isUpload" ext:cls="Ext.data.Connection">File uploads</a> are not performed using normal "Ajax" techniques, that
37      * is they are <b>not</b> performed using XMLHttpRequests. Instead the form is submitted in the standard
38      * manner with the DOM <tt>&lt;form></tt> element temporarily modified to have its
39      * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
40      * to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document
41      * but removed after the return data has been gathered.</p>
42      * <p>The server response is parsed by the browser to create the document for the IFRAME. If the
43      * server is using JSON to send the return object, then the
44      * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
45      * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
46      * <p>Characters which are significant to an HTML parser must be sent as HTML entities, so encode
47      * "&lt;" as "&amp;lt;", "&amp;" as "&amp;amp;" etc.</p>
48      * <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
49      * is created containing a <tt>responseText</tt> property in order to conform to the
50      * requirements of event handlers and callbacks.</p>
51      * <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>
52      * and some server technologies (notably JEE) may require some custom processing in order to
53      * retrieve parameter names and parameter values from the packet content.</p>
54      * @constructor
55      * @param {Object} config a configuration object.
56      */
57     Ext.data.Connection = function(config){
58         Ext.apply(this, config);
59         this.addEvents(
60             <div id="event-Ext.data.Connection-beforerequest"></div>/**
61              * @event beforerequest
62              * Fires before a network request is made to retrieve a data object.
63              * @param {Connection} conn This Connection object.
64              * @param {Object} options The options config object passed to the {@link #request} method.
65              */
66             BEFOREREQUEST,
67             <div id="event-Ext.data.Connection-requestcomplete"></div>/**
68              * @event requestcomplete
69              * Fires if the request was successfully completed.
70              * @param {Connection} conn This Connection object.
71              * @param {Object} response The XHR object containing the response data.
72              * See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>
73              * for details.
74              * @param {Object} options The options config object passed to the {@link #request} method.
75              */
76             REQUESTCOMPLETE,
77             <div id="event-Ext.data.Connection-requestexception"></div>/**
78              * @event requestexception
79              * Fires if an error HTTP status was returned from the server.
80              * See <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP Status Code Definitions</a>
81              * for details of HTTP status codes.
82              * @param {Connection} conn This Connection object.
83              * @param {Object} response The XHR object containing the response data.
84              * See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>
85              * for details.
86              * @param {Object} options The options config object passed to the {@link #request} method.
87              */
88             REQUESTEXCEPTION
89         );
90         Ext.data.Connection.superclass.constructor.call(this);
91     };
92
93     Ext.extend(Ext.data.Connection, Ext.util.Observable, {
94         <div id="cfg-Ext.data.Connection-url"></div>/**
95          * @cfg {String} url (Optional) <p>The default URL to be used for requests to the server. Defaults to undefined.</p>
96          * <p>The <code>url</code> config may be a function which <i>returns</i> the URL to use for the Ajax request. The scope
97          * (<code><b>this</b></code> reference) of the function is the <code>scope</code> option passed to the {@link #request} method.</p>
98          */
99         <div id="cfg-Ext.data.Connection-extraParams"></div>/**
100          * @cfg {Object} extraParams (Optional) An object containing properties which are used as
101          * extra parameters to each request made by this object. (defaults to undefined)
102          */
103         <div id="cfg-Ext.data.Connection-defaultHeaders"></div>/**
104          * @cfg {Object} defaultHeaders (Optional) An object containing request headers which are added
105          *  to each request made by this object. (defaults to undefined)
106          */
107         <div id="cfg-Ext.data.Connection-method"></div>/**
108          * @cfg {String} method (Optional) The default HTTP method to be used for requests.
109          * (defaults to undefined; if not set, but {@link #request} params are present, POST will be used;
110          * otherwise, GET will be used.)
111          */
112         <div id="cfg-Ext.data.Connection-timeout"></div>/**
113          * @cfg {Number} timeout (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000)
114          */
115         timeout : 30000,
116         <div id="cfg-Ext.data.Connection-autoAbort"></div>/**
117          * @cfg {Boolean} autoAbort (Optional) Whether this request should abort any pending requests. (defaults to false)
118          * @type Boolean
119          */
120         autoAbort:false,
121
122         <div id="cfg-Ext.data.Connection-disableCaching"></div>/**
123          * @cfg {Boolean} disableCaching (Optional) True to add a unique cache-buster param to GET requests. (defaults to true)
124          * @type Boolean
125          */
126         disableCaching: true,
127
128         <div id="cfg-Ext.data.Connection-disableCachingParam"></div>/**
129          * @cfg {String} disableCachingParam (Optional) Change the parameter which is sent went disabling caching
130          * through a cache buster. Defaults to '_dc'
131          * @type String
132          */
133         disableCachingParam: '_dc',
134
135         <div id="method-Ext.data.Connection-request"></div>/**
136          * <p>Sends an HTTP request to a remote server.</p>
137          * <p><b>Important:</b> Ajax server requests are asynchronous, and this call will
138          * return before the response has been received. Process any returned data
139          * in a callback function.</p>
140          * <pre><code>
141 Ext.Ajax.request({
142    url: 'ajax_demo/sample.json',
143    success: function(response, opts) {
144       var obj = Ext.decode(response.responseText);
145       console.dir(obj);
146    },
147    failure: function(response, opts) {
148       console.log('server-side failure with status code ' + response.status);
149    }
150 });
151          * </code></pre>
152          * <p>To execute a callback function in the correct scope, use the <tt>scope</tt> option.</p>
153          * @param {Object} options An object which may contain the following properties:<ul>
154          * <li><b>url</b> : String/Function (Optional)<div class="sub-desc">The URL to
155          * which to send the request, or a function to call which returns a URL string. The scope of the
156          * function is specified by the <tt>scope</tt> option. Defaults to the configured
157          * <tt>{@link #url}</tt>.</div></li>
158          * <li><b>params</b> : Object/String/Function (Optional)<div class="sub-desc">
159          * An object containing properties which are used as parameters to the
160          * request, a url encoded string or a function to call to get either. The scope of the function
161          * is specified by the <tt>scope</tt> option.</div></li>
162          * <li><b>method</b> : String (Optional)<div class="sub-desc">The HTTP method to use
163          * for the request. Defaults to the configured method, or if no method was configured,
164          * "GET" if no parameters are being sent, and "POST" if parameters are being sent.  Note that
165          * the method name is case-sensitive and should be all caps.</div></li>
166          * <li><b>callback</b> : Function (Optional)<div class="sub-desc">The
167          * function to be called upon receipt of the HTTP response. The callback is
168          * called regardless of success or failure and is passed the following
169          * parameters:<ul>
170          * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>
171          * <li><b>success</b> : Boolean<div class="sub-desc">True if the request succeeded.</div></li>
172          * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.
173          * See <a href="http://www.w3.org/TR/XMLHttpRequest/">http://www.w3.org/TR/XMLHttpRequest/</a> for details about
174          * accessing elements of the response.</div></li>
175          * </ul></div></li>
176          * <li><a id="request-option-success"></a><b>success</b> : Function (Optional)<div class="sub-desc">The function
177          * to be called upon success of the request. The callback is passed the following
178          * parameters:<ul>
179          * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.</div></li>
180          * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>
181          * </ul></div></li>
182          * <li><b>failure</b> : Function (Optional)<div class="sub-desc">The function
183          * to be called upon failure of the request. The callback is passed the
184          * following parameters:<ul>
185          * <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.</div></li>
186          * <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>
187          * </ul></div></li>
188          * <li><b>scope</b> : Object (Optional)<div class="sub-desc">The scope in
189          * which to execute the callbacks: The "this" object for the callback function. If the <tt>url</tt>, or <tt>params</tt> options were
190          * specified as functions from which to draw values, then this also serves as the scope for those function calls.
191          * Defaults to the browser window.</div></li>
192          * <li><b>timeout</b> : Number (Optional)<div class="sub-desc">The timeout in milliseconds to be used for this request. Defaults to 30 seconds.</div></li>
193          * <li><b>form</b> : Element/HTMLElement/String (Optional)<div class="sub-desc">The <tt>&lt;form&gt;</tt>
194          * Element or the id of the <tt>&lt;form&gt;</tt> to pull parameters from.</div></li>
195          * <li><a id="request-option-isUpload"></a><b>isUpload</b> : Boolean (Optional)<div class="sub-desc"><b>Only meaningful when used
196          * with the <tt>form</tt> option</b>.
197          * <p>True if the form object is a file upload (will be set automatically if the form was
198          * configured with <b><tt>enctype</tt></b> "multipart/form-data").</p>
199          * <p>File uploads are not performed using normal "Ajax" techniques, that is they are <b>not</b>
200          * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
201          * DOM <tt>&lt;form></tt> element temporarily modified to have its
202          * <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
203          * to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document
204          * but removed after the return data has been gathered.</p>
205          * <p>The server response is parsed by the browser to create the document for the IFRAME. If the
206          * server is using JSON to send the return object, then the
207          * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
208          * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
209          * <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
210          * is created containing a <tt>responseText</tt> property in order to conform to the
211          * requirements of event handlers and callbacks.</p>
212          * <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>
213          * and some server technologies (notably JEE) may require some custom processing in order to
214          * retrieve parameter names and parameter values from the packet content.</p>
215          * </div></li>
216          * <li><b>headers</b> : Object (Optional)<div class="sub-desc">Request
217          * headers to set for the request.</div></li>
218          * <li><b>xmlData</b> : Object (Optional)<div class="sub-desc">XML document
219          * to use for the post. Note: This will be used instead of params for the post
220          * data. Any params will be appended to the URL.</div></li>
221          * <li><b>jsonData</b> : Object/String (Optional)<div class="sub-desc">JSON
222          * data to use as the post. Note: This will be used instead of params for the post
223          * data. Any params will be appended to the URL.</div></li>
224          * <li><b>disableCaching</b> : Boolean (Optional)<div class="sub-desc">True
225          * to add a unique cache-buster param to GET requests.</div></li>
226          * </ul></p>
227          * <p>The options object may also contain any other property which might be needed to perform
228          * postprocessing in a callback because it is passed to callback functions.</p>
229          * @return {Number} transactionId The id of the server transaction. This may be used
230          * to cancel the request.
231          */
232         request : function(o){
233             var me = this;
234             if(me.fireEvent(BEFOREREQUEST, me, o)){
235                 if (o.el) {
236                     if(!Ext.isEmpty(o.indicatorText)){
237                         me.indicatorText = '<div class="loading-indicator">'+o.indicatorText+"</div>";
238                     }
239                     if(me.indicatorText) {
240                         Ext.getDom(o.el).innerHTML = me.indicatorText;
241                     }
242                     o.success = (Ext.isFunction(o.success) ? o.success : function(){}).createInterceptor(function(response) {
243                         Ext.getDom(o.el).innerHTML = response.responseText;
244                     });
245                 }
246
247                 var p = o.params,
248                     url = o.url || me.url,
249                     method,
250                     cb = {success: me.handleResponse,
251                           failure: me.handleFailure,
252                           scope: me,
253                           argument: {options: o},
254                           timeout : o.timeout || me.timeout
255                     },
256                     form,
257                     serForm;
258
259
260                 if (Ext.isFunction(p)) {
261                     p = p.call(o.scope||WINDOW, o);
262                 }
263
264                 p = Ext.urlEncode(me.extraParams, Ext.isObject(p) ? Ext.urlEncode(p) : p);
265
266                 if (Ext.isFunction(url)) {
267                     url = url.call(o.scope || WINDOW, o);
268                 }
269
270                 if((form = Ext.getDom(o.form))){
271                     url = url || form.action;
272                      if(o.isUpload || /multipart\/form-data/i.test(form.getAttribute("enctype"))) {
273                          return me.doFormUpload.call(me, o, p, url);
274                      }
275                     serForm = Ext.lib.Ajax.serializeForm(form);
276                     p = p ? (p + '&' + serForm) : serForm;
277                 }
278
279                 method = o.method || me.method || ((p || o.xmlData || o.jsonData) ? POST : GET);
280
281                 if(method === GET && (me.disableCaching && o.disableCaching !== false) || o.disableCaching === true){
282                     var dcp = o.disableCachingParam || me.disableCachingParam;
283                     url = Ext.urlAppend(url, dcp + '=' + (new Date().getTime()));
284                 }
285
286                 o.headers = Ext.apply(o.headers || {}, me.defaultHeaders || {});
287
288                 if(o.autoAbort === true || me.autoAbort) {
289                     me.abort();
290                 }
291
292                 if((method == GET || o.xmlData || o.jsonData) && p){
293                     url = Ext.urlAppend(url, p);
294                     p = '';
295                 }
296                 return (me.transId = Ext.lib.Ajax.request(method, url, cb, p, o));
297             }else{
298                 return o.callback ? o.callback.apply(o.scope, [o,UNDEFINED,UNDEFINED]) : null;
299             }
300         },
301
302         <div id="method-Ext.data.Connection-isLoading"></div>/**
303          * Determine whether this object has a request outstanding.
304          * @param {Number} transactionId (Optional) defaults to the last transaction
305          * @return {Boolean} True if there is an outstanding request.
306          */
307         isLoading : function(transId){
308             return transId ? Ext.lib.Ajax.isCallInProgress(transId) : !! this.transId;
309         },
310
311         <div id="method-Ext.data.Connection-abort"></div>/**
312          * Aborts any outstanding request.
313          * @param {Number} transactionId (Optional) defaults to the last transaction
314          */
315         abort : function(transId){
316             if(transId || this.isLoading()){
317                 Ext.lib.Ajax.abort(transId || this.transId);
318             }
319         },
320
321         // private
322         handleResponse : function(response){
323             this.transId = false;
324             var options = response.argument.options;
325             response.argument = options ? options.argument : null;
326             this.fireEvent(REQUESTCOMPLETE, this, response, options);
327             if(options.success){
328                 options.success.call(options.scope, response, options);
329             }
330             if(options.callback){
331                 options.callback.call(options.scope, options, true, response);
332             }
333         },
334
335         // private
336         handleFailure : function(response, e){
337             this.transId = false;
338             var options = response.argument.options;
339             response.argument = options ? options.argument : null;
340             this.fireEvent(REQUESTEXCEPTION, this, response, options, e);
341             if(options.failure){
342                 options.failure.call(options.scope, response, options);
343             }
344             if(options.callback){
345                 options.callback.call(options.scope, options, false, response);
346             }
347         },
348
349         // private
350         doFormUpload : function(o, ps, url){
351             var id = Ext.id(),
352                 doc = document,
353                 frame = doc.createElement('iframe'),
354                 form = Ext.getDom(o.form),
355                 hiddens = [],
356                 hd,
357                 encoding = 'multipart/form-data',
358                 buf = {
359                     target: form.target,
360                     method: form.method,
361                     encoding: form.encoding,
362                     enctype: form.enctype,
363                     action: form.action
364                 };
365
366             /*
367              * Originally this behaviour was modified for Opera 10 to apply the secure URL after
368              * the frame had been added to the document. It seems this has since been corrected in
369              * Opera so the behaviour has been reverted, the URL will be set before being added.
370              */
371             Ext.fly(frame).set({
372                 id: id,
373                 name: id,
374                 cls: 'x-hidden',
375                 src: Ext.SSL_SECURE_URL
376             }); 
377
378             doc.body.appendChild(frame);
379
380             // This is required so that IE doesn't pop the response up in a new window.
381             if(Ext.isIE){
382                document.frames[id].name = id;
383             }
384
385
386             Ext.fly(form).set({
387                 target: id,
388                 method: POST,
389                 enctype: encoding,
390                 encoding: encoding,
391                 action: url || buf.action
392             });
393
394             // add dynamic params
395             Ext.iterate(Ext.urlDecode(ps, false), function(k, v){
396                 hd = doc.createElement('input');
397                 Ext.fly(hd).set({
398                     type: 'hidden',
399                     value: v,
400                     name: k
401                 });
402                 form.appendChild(hd);
403                 hiddens.push(hd);
404             });
405
406             function cb(){
407                 var me = this,
408                     // bogus response object
409                     r = {responseText : '',
410                          responseXML : null,
411                          argument : o.argument},
412                     doc,
413                     firstChild;
414
415                 try{
416                     doc = frame.contentWindow.document || frame.contentDocument || WINDOW.frames[id].document;
417                     if(doc){
418                         if(doc.body){
419                             if(/textarea/i.test((firstChild = doc.body.firstChild || {}).tagName)){ // json response wrapped in textarea
420                                 r.responseText = firstChild.value;
421                             }else{
422                                 r.responseText = doc.body.innerHTML;
423                             }
424                         }
425                         //in IE the document may still have a body even if returns XML.
426                         r.responseXML = doc.XMLDocument || doc;
427                     }
428                 }
429                 catch(e) {}
430
431                 Ext.EventManager.removeListener(frame, LOAD, cb, me);
432
433                 me.fireEvent(REQUESTCOMPLETE, me, r, o);
434
435                 function runCallback(fn, scope, args){
436                     if(Ext.isFunction(fn)){
437                         fn.apply(scope, args);
438                     }
439                 }
440
441                 runCallback(o.success, o.scope, [r, o]);
442                 runCallback(o.callback, o.scope, [o, true, r]);
443
444                 if(!me.debugUploads){
445                     setTimeout(function(){Ext.removeNode(frame);}, 100);
446                 }
447             }
448
449             Ext.EventManager.on(frame, LOAD, cb, this);
450             form.submit();
451
452             Ext.fly(form).set(buf);
453             Ext.each(hiddens, function(h) {
454                 Ext.removeNode(h);
455             });
456         }
457     });
458 })();
459
460 <div id="cls-Ext.Ajax"></div>/**
461  * @class Ext.Ajax
462  * @extends Ext.data.Connection
463  * <p>The global Ajax request class that provides a simple way to make Ajax requests
464  * with maximum flexibility.</p>
465  * <p>Since Ext.Ajax is a singleton, you can set common properties/events for it once
466  * and override them at the request function level only if necessary.</p>
467  * <p>Common <b>Properties</b> you may want to set are:<div class="mdetail-params"><ul>
468  * <li><b><tt>{@link #method}</tt></b><p class="sub-desc"></p></li>
469  * <li><b><tt>{@link #extraParams}</tt></b><p class="sub-desc"></p></li>
470  * <li><b><tt>{@link #url}</tt></b><p class="sub-desc"></p></li>
471  * </ul></div>
472  * <pre><code>
473 // Default headers to pass in every request
474 Ext.Ajax.defaultHeaders = {
475     'Powered-By': 'Ext'
476 };
477  * </code></pre>
478  * </p>
479  * <p>Common <b>Events</b> you may want to set are:<div class="mdetail-params"><ul>
480  * <li><b><tt>{@link Ext.data.Connection#beforerequest beforerequest}</tt></b><p class="sub-desc"></p></li>
481  * <li><b><tt>{@link Ext.data.Connection#requestcomplete requestcomplete}</tt></b><p class="sub-desc"></p></li>
482  * <li><b><tt>{@link Ext.data.Connection#requestexception requestexception}</tt></b><p class="sub-desc"></p></li>
483  * </ul></div>
484  * <pre><code>
485 // Example: show a spinner during all Ajax requests
486 Ext.Ajax.on('beforerequest', this.showSpinner, this);
487 Ext.Ajax.on('requestcomplete', this.hideSpinner, this);
488 Ext.Ajax.on('requestexception', this.hideSpinner, this);
489  * </code></pre>
490  * </p>
491  * <p>An example request:</p>
492  * <pre><code>
493 // Basic request
494 Ext.Ajax.{@link Ext.data.Connection#request request}({
495    url: 'foo.php',
496    success: someFn,
497    failure: otherFn,
498    headers: {
499        'my-header': 'foo'
500    },
501    params: { foo: 'bar' }
502 });
503
504 // Simple ajax form submission
505 Ext.Ajax.{@link Ext.data.Connection#request request}({
506     form: 'some-form',
507     params: 'foo=bar'
508 });
509  * </code></pre>
510  * </p>
511  * @singleton
512  */
513 Ext.Ajax = new Ext.data.Connection({
514     <div id="cfg-Ext.Ajax-url"></div>/**
515      * @cfg {String} url @hide
516      */
517     <div id="cfg-Ext.Ajax-extraParams"></div>/**
518      * @cfg {Object} extraParams @hide
519      */
520     <div id="cfg-Ext.Ajax-defaultHeaders"></div>/**
521      * @cfg {Object} defaultHeaders @hide
522      */
523     <div id="cfg-Ext.Ajax-method"></div>/**
524      * @cfg {String} method (Optional) @hide
525      */
526     <div id="cfg-Ext.Ajax-timeout"></div>/**
527      * @cfg {Number} timeout (Optional) @hide
528      */
529     <div id="cfg-Ext.Ajax-autoAbort"></div>/**
530      * @cfg {Boolean} autoAbort (Optional) @hide
531      */
532
533     <div id="cfg-Ext.Ajax-disableCaching"></div>/**
534      * @cfg {Boolean} disableCaching (Optional) @hide
535      */
536
537     <div id="prop-Ext.Ajax-disableCaching"></div>/**
538      * @property  disableCaching
539      * True to add a unique cache-buster param to GET requests. (defaults to true)
540      * @type Boolean
541      */
542     <div id="prop-Ext.Ajax-url"></div>/**
543      * @property  url
544      * The default URL to be used for requests to the server. (defaults to undefined)
545      * If the server receives all requests through one URL, setting this once is easier than
546      * entering it on every request.
547      * @type String
548      */
549     <div id="prop-Ext.Ajax-extraParams"></div>/**
550      * @property  extraParams
551      * An object containing properties which are used as extra parameters to each request made
552      * by this object (defaults to undefined). Session information and other data that you need
553      * to pass with each request are commonly put here.
554      * @type Object
555      */
556     <div id="prop-Ext.Ajax-defaultHeaders"></div>/**
557      * @property  defaultHeaders
558      * An object containing request headers which are added to each request made by this object
559      * (defaults to undefined).
560      * @type Object
561      */
562     <div id="prop-Ext.Ajax-method"></div>/**
563      * @property  method
564      * The default HTTP method to be used for requests. Note that this is case-sensitive and
565      * should be all caps (defaults to undefined; if not set but params are present will use
566      * <tt>"POST"</tt>, otherwise will use <tt>"GET"</tt>.)
567      * @type String
568      */
569     <div id="prop-Ext.Ajax-timeout"></div>/**
570      * @property  timeout
571      * The timeout in milliseconds to be used for requests. (defaults to 30000)
572      * @type Number
573      */
574
575     <div id="prop-Ext.Ajax-autoAbort"></div>/**
576      * @property  autoAbort
577      * Whether a new request should abort any pending requests. (defaults to false)
578      * @type Boolean
579      */
580     autoAbort : false,
581
582     <div id="method-Ext.Ajax-serializeForm"></div>/**
583      * Serialize the passed form into a url encoded string
584      * @param {String/HTMLElement} form
585      * @return {String}
586      */
587     serializeForm : function(form){
588         return Ext.lib.Ajax.serializeForm(form);
589     }
590 });
591 </pre>    
592 </body>
593 </html>