5 * @extends Ext.data.Connection
7 A singleton instance of an {@link Ext.data.Connection}. This class
8 is used to communicate with your server side code. It can be used as follows:
15 success: function(response){
16 var text = response.responseText;
17 // process server response here
21 Default options for all requests can be set be changing a property on the Ext.Ajax class:
23 Ext.Ajax.timeout = 60000; // 60 seconds
25 Any options specified in the request method for the Ajax request will override any
26 defaults set on the Ext.Ajax class. In the code sample below, the timeout for the
27 request will be 60 seconds.
29 Ext.Ajax.timeout = 120000; // 120 seconds
35 In general, this class will be used for all Ajax requests in your application.
36 The main reason for creating a separate {@link Ext.data.Connection} is for a
37 series of requests that share common settings that are different to all other
38 requests in the application.
41 Ext.define('Ext.Ajax', {
42 extend: 'Ext.data.Connection',
46 * @cfg {String} url @hide
49 * @cfg {Object} extraParams @hide
52 * @cfg {Object} defaultHeaders @hide
55 * @cfg {String} method (Optional) @hide
58 * @cfg {Number} timeout (Optional) @hide
61 * @cfg {Boolean} autoAbort (Optional) @hide
65 * @cfg {Boolean} disableCaching (Optional) @hide
69 * @property disableCaching
70 * True to add a unique cache-buster param to GET requests. (defaults to true)
75 * The default URL to be used for requests to the server. (defaults to undefined)
76 * If the server receives all requests through one URL, setting this once is easier than
77 * entering it on every request.
81 * @property extraParams
82 * An object containing properties which are used as extra parameters to each request made
83 * by this object (defaults to undefined). Session information and other data that you need
84 * to pass with each request are commonly put here.
88 * @property defaultHeaders
89 * An object containing request headers which are added to each request made by this object
90 * (defaults to undefined).
95 * The default HTTP method to be used for requests. Note that this is case-sensitive and
96 * should be all caps (defaults to undefined; if not set but params are present will use
97 * <tt>"POST"</tt>, otherwise will use <tt>"GET"</tt>.)
102 * The timeout in milliseconds to be used for requests. (defaults to 30000)
107 * @property autoAbort
108 * Whether a new request should abort any pending requests. (defaults to false)