1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-Ajax'>/**
2 </span> * @class Ext.Ajax
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',
45 <span id='Ext-Ajax-cfg-url'> /**
46 </span> * @cfg {String} url @hide
48 <span id='Ext-Ajax-cfg-extraParams'> /**
49 </span> * @cfg {Object} extraParams @hide
51 <span id='Ext-Ajax-cfg-defaultHeaders'> /**
52 </span> * @cfg {Object} defaultHeaders @hide
54 <span id='Ext-Ajax-cfg-method'> /**
55 </span> * @cfg {String} method (Optional) @hide
57 <span id='Ext-Ajax-cfg-timeout'> /**
58 </span> * @cfg {Number} timeout (Optional) @hide
60 <span id='Ext-Ajax-cfg-autoAbort'> /**
61 </span> * @cfg {Boolean} autoAbort (Optional) @hide
64 <span id='Ext-Ajax-cfg-disableCaching'> /**
65 </span> * @cfg {Boolean} disableCaching (Optional) @hide
68 <span id='Ext-Ajax-property-disableCaching'> /**
69 </span> * @property disableCaching
70 * True to add a unique cache-buster param to GET requests. (defaults to true)
73 <span id='Ext-Ajax-property-url'> /**
74 </span> * @property url
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.
80 <span id='Ext-Ajax-property-extraParams'> /**
81 </span> * @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.
87 <span id='Ext-Ajax-property-defaultHeaders'> /**
88 </span> * @property defaultHeaders
89 * An object containing request headers which are added to each request made by this object
90 * (defaults to undefined).
93 <span id='Ext-Ajax-property-method'> /**
94 </span> * @property method
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>.)
100 <span id='Ext-Ajax-property-timeout'> /**
101 </span> * @property timeout
102 * The timeout in milliseconds to be used for requests. (defaults to 30000)
106 <span id='Ext-Ajax-property-autoAbort'> /**
107 </span> * @property autoAbort
108 * Whether a new request should abort any pending requests. (defaults to false)
112 });</pre></pre></body></html>