2cb4e18dec8481044e0374c7d9d2a75466d6561e
[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  * @class Roo.Ajax
15  * @extends Roo.data.Connection
16  * @instanceOf  Roo.data.Connection
17  */
18 Roo.Ajax = new Roo.data.Connection({
19     // fix up the docs
20     
21     /**
22      * fix up scoping
23      * @scope Roo.Ajax
24      */
25     
26    /**
27      * @cfg {String} url @hide
28      */
29     /**
30      * @cfg {Object} extraParams @hide
31      */
32     /**
33      * @cfg {Object} defaultHeaders @hide
34      */
35     /**
36      * @cfg {String} method (Optional) @hide
37      */
38     /**
39      * @cfg {Number} timeout (Optional) @hide
40      */
41     /**
42      * @cfg {Boolean} autoAbort (Optional) @hide
43      */
44
45     /**
46      * @cfg {Boolean} disableCaching (Optional) @hide
47      */
48
49     /**
50      * @property  disableCaching
51      * True to add a unique cache-buster param to GET requests. (defaults to true)
52      * @type Boolean
53      */
54     /**
55      * @property  url
56      * The default URL to be used for requests to the server. (defaults to undefined)
57      * @type String
58      */
59     /**
60      * @property  extraParams
61      * An object containing properties which are used as
62      * extra parameters to each request made by this object. (defaults to undefined)
63      * @type Object
64      */
65     /**
66      * @property  defaultHeaders
67      * An object containing request headers which are added to each request made by this object. (defaults to undefined)
68      * @type Object
69      */
70     /**
71      * @property  method
72      * The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET)
73      * @type String
74      */
75     /**
76      * @property  timeout
77      * The timeout in milliseconds to be used for requests. (defaults to 30000)
78      * @type Number
79      */
80
81     /**
82      * @property  autoAbort
83      * Whether a new request should abort any pending requests. (defaults to false)
84      * @type Boolean
85      */
86     autoAbort : false,
87
88     /**
89      * Serialize the passed form into a url encoded string
90      * @param {String/HTMLElement} form
91      * @return {String}
92      */
93     serializeForm : function(form){
94         return Roo.lib.Ajax.serializeForm(form);
95     }
96 });