Roo/Ajax.js
[roojs1] / Roo / Ajax.js
1 /*
2  * Based on:
3  * Ext JS Library 1.1.1
4  * Copyright(c) 2006-2007, Ext JS, LLC.
5  *
6  * Originally Released Under LGPL - original licence link has changed is not relivant.
7  *
8  * Fork - LGPL
9  * <script type="text/javascript">
10  */
11  
12 /**
13  * Global Ajax request class.
14  * 
15  * @class Roo.Ajax
16  * @extends Roo.data.Connection
17  * @static
18  * 
19  * @cfg {String} url  The default URL to be used for requests to the server. (defaults to undefined)
20  * @cfg {Object} extraParams  An object containing properties which are used as extra parameters to each request made by this object. (defaults to undefined)
21  * @cfg {Object} defaultHeaders  An object containing request headers which are added to each request made by this object. (defaults to undefined)
22  * @cfg {String} method (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)
23  * @cfg {Number} timeout (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000)
24  * @cfg {Boolean} autoAbort (Optional) Whether a new request should abort any pending requests. (defaults to false)
25  * @cfg {Boolean} disableCaching (Optional)   True to add a unique cache-buster param to GET requests. (defaults to true)
26  */
27
28 /**
29  * @class Roo.Ajax
30  * @extends Roo.data.Connection
31  * Global Ajax request class.
32  *
33  * @singleton
34  */
35 Roo.Ajax = new Roo.data.Connection({
36     
37     autoAbort : false,
38
39     /**
40      * Serialize the passed form into a url encoded string
41      * @param {String/HTMLElement} form
42      * @return {String}
43      */
44     serializeForm : function(form){
45         return Roo.lib.Ajax.serializeForm(form);
46     }
47 });