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