commit extjs-2.2.1
[extjs.git] / docs / output / Ext.Ajax.html
1         <div class="body-wrap">
2         <div class="top-tools">
3             <a class="inner-link" href="#Ext.Ajax-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4             <a class="inner-link" href="#Ext.Ajax-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5             <a class="inner-link" href="#Ext.Ajax-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6                             <a class="inner-link" href="#Ext.Ajax-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7                         <a class="bookmark" href="../docs/?class=Ext.Ajax"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
8         </div>
9                 <div class="inheritance res-block">
10 <pre class="res-block-inner"><a ext:cls="Ext.util.Observable" ext:member="" href="output/Ext.util.Observable.html">Observable</a>
11   <img src="resources/elbow-end.gif"/><a ext:cls="Ext.data.Connection" ext:member="" href="output/Ext.data.Connection.html">Connection</a>
12     <img src="resources/elbow-end.gif"/>Ajax</pre></div>
13                 <h1>Class Ext.Ajax</h1>
14         <table cellspacing="0">
15             <tr><td class="label">Package:</td><td class="hd-info">Ext</td></tr>
16             <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/Connection.js" target="_blank">Connection.js</a></td></tr>
17             <tr><td class="label">Class:</td><td class="hd-info">Ajax</td></tr>
18                                     <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.data.Connection" ext:member="" href="output/Ext.data.Connection.html">Connection</a></td></tr>
19                     </table>
20         <div class="description">
21             Global Ajax request class.  Provides a simple way to make Ajax requests with maximum flexibility.  Example usage:
22 <pre><code><i>// Basic request</i>
23 Ext.Ajax.request({
24    url: <em>'foo.php'</em>,
25    success: someFn,
26    failure: otherFn,
27    headers: {
28        <em>'my-header'</em>: <em>'foo'</em>
29    },
30    params: { foo: <em>'bar'</em> }
31 });
32
33 <i>// Simple ajax form submission</i>
34 Ext.Ajax.request({
35     form: <em>'some-form'</em>,
36     params: <em>'foo=bar'</em>
37 });
38
39 <i>// Default headers to pass <b>in</b> every request</i>
40 Ext.Ajax.defaultHeaders = {
41     <em>'Powered-By'</em>: <em>'Ext'</em>
42 };
43
44 <i>// Global Ajax events can be handled on every request!</i>
45 Ext.Ajax.on(<em>'beforerequest'</em>, <b>this</b>.showSpinner, <b>this</b>);</code></pre><br><br><i>This class is a singleton and cannot be created directly.</i>        </div>
46         
47         <div class="hr"></div>
48                 <a id="Ext.Ajax-configs"></a>
49         <h2>Config Options</h2>
50         <table cellspacing="0" class="member-table">
51             <tr>
52                 <th class="sig-header" colspan="2">Config Options</th>
53                 <th class="msource-header">Defined By</th>
54             </tr>
55                 <tr class="config-row inherited">\r
56         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
57         <td class="sig">\r
58         <a id="Ext.Ajax-disableCachingParam"></a>\r
59             <b>disableCachingParam</b> : String            <div class="mdesc">\r
60                             (Optional) Change the parameter which is sent went disabling caching through a cache buster. Defaults to '_dc'                        </div>\r
61         </td>\r
62         <td class="msource"><a ext:cls="Ext.data.Connection" ext:member="#disableCachingParam" href="output/Ext.data.Connection.html#disableCachingParam">Connection</a></td>\r
63     </tr>\r
64         <tr class="config-row inherited alt expandable">\r
65         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
66         <td class="sig">\r
67         <a id="Ext.Ajax-listeners"></a>\r
68             <b>listeners</b> : Object            <div class="mdesc">\r
69                         <div class="short">(optional) A config object containing one or more event handlers to be added to this object during initialization. Th...</div>\r
70             <div class="long">\r
71                 (optional) A config object containing one or more event handlers to be added to this object during initialization. This should be a valid listeners config object as specified in the <a ext:cls="Ext.util.Observable" ext:member="addListener" href="output/Ext.util.Observable.html#addListener">addListener</a> example for attaching multiple handlers at once.            </div>\r
72                         </div>\r
73         </td>\r
74         <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#listeners" href="output/Ext.util.Observable.html#listeners">Observable</a></td>\r
75     </tr>\r
76             </table>
77                 <a id="Ext.Ajax-props"></a>
78         <h2>Public Properties</h2>
79                 <table cellspacing="0" class="member-table">
80             <tr>
81                 <th class="sig-header" colspan="2">Property</th>
82                 <th class="msource-header">Defined By</th>
83             </tr>
84                 <tr class="property-row">\r
85         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
86         <td class="sig">\r
87         <a id="Ext.Ajax-autoAbort"></a>\r
88             <b>autoAbort</b> : Boolean            <div class="mdesc">\r
89                             
90 Whether a new request should abort any pending requests. (defaults to false)                        </div>\r
91         </td>\r
92         <td class="msource">Ajax</td>\r
93     </tr>\r
94         <tr class="property-row alt">\r
95         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
96         <td class="sig">\r
97         <a id="Ext.Ajax-defaultHeaders"></a>\r
98             <b>defaultHeaders</b> : Object            <div class="mdesc">\r
99                             
100 An object containing request headers which are added to each request made by this object. (defaults to undefined)                        </div>\r
101         </td>\r
102         <td class="msource">Ajax</td>\r
103     </tr>\r
104         <tr class="property-row">\r
105         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
106         <td class="sig">\r
107         <a id="Ext.Ajax-disableCaching"></a>\r
108             <b>disableCaching</b> : Boolean            <div class="mdesc">\r
109                             
110 True to add a unique cache-buster param to GET requests. (defaults to true)                        </div>\r
111         </td>\r
112         <td class="msource">Ajax</td>\r
113     </tr>\r
114         <tr class="property-row alt expandable">\r
115         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
116         <td class="sig">\r
117         <a id="Ext.Ajax-extraParams"></a>\r
118             <b>extraParams</b> : Object            <div class="mdesc">\r
119                         <div class="short">
120 An object containing properties which are used as
121 extra parameters to each request made by this object. (defaults to...</div>\r
122             <div class="long">\r
123                 
124 An object containing properties which are used as
125 extra parameters to each request made by this object. (defaults to undefined)            </div>\r
126                         </div>\r
127         </td>\r
128         <td class="msource">Ajax</td>\r
129     </tr>\r
130         <tr class="property-row expandable">\r
131         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
132         <td class="sig">\r
133         <a id="Ext.Ajax-method"></a>\r
134             <b>method</b> : String            <div class="mdesc">\r
135                         <div class="short">
136 The default HTTP method to be used for requests. Note that this is case-sensitive and should be all caps (defaults
137 t...</div>\r
138             <div class="long">\r
139                 
140 The default HTTP method to be used for requests. Note that this is case-sensitive and should be all caps (defaults
141 to undefined; if not set but parms are present will use "POST," otherwise "GET.")            </div>\r
142                         </div>\r
143         </td>\r
144         <td class="msource">Ajax</td>\r
145     </tr>\r
146         <tr class="property-row alt">\r
147         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
148         <td class="sig">\r
149         <a id="Ext.Ajax-timeout"></a>\r
150             <b>timeout</b> : Number            <div class="mdesc">\r
151                             
152 The timeout in milliseconds to be used for requests. (defaults to 30000)                        </div>\r
153         </td>\r
154         <td class="msource">Ajax</td>\r
155     </tr>\r
156         <tr class="property-row">\r
157         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
158         <td class="sig">\r
159         <a id="Ext.Ajax-url"></a>\r
160             <b>url</b> : String            <div class="mdesc">\r
161                             
162 The default URL to be used for requests to the server. (defaults to undefined)                        </div>\r
163         </td>\r
164         <td class="msource">Ajax</td>\r
165     </tr>\r
166             </table>
167                 <a id="Ext.Ajax-methods"></a>
168         <h2>Public Methods</h2>
169                 <table cellspacing="0" class="member-table">
170             <tr>
171                 <th class="sig-header" colspan="2">Method</th>
172                 <th class="msource-header">Defined By</th>
173             </tr>
174                 <tr class="method-row inherited expandable">\r
175         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
176         <td class="sig">\r
177         <a id="Ext.Ajax-abort"></a>\r
178             <b>abort</b>(&nbsp;<span class="optional" title="Optional">[<code>Number transactionId</code>]</span>&nbsp;) : void            <div class="mdesc">\r
179                         <div class="short">Aborts any outstanding request.</div>\r
180             <div class="long">\r
181                 Aborts any outstanding request.    <div class="mdetail-params">\r
182         <strong>Parameters:</strong>\r
183         <ul><li><code>transactionId</code> : Number<div class="sub-desc">(Optional) defaults to the last transaction</div></li>        </ul>\r
184         <strong>Returns:</strong>\r
185         <ul>\r
186             <li><code>void</code></li>\r
187         </ul>\r
188     </div>\r
189                 </div>\r
190                         </div>\r
191         </td>\r
192         <td class="msource"><a ext:cls="Ext.data.Connection" ext:member="#abort" href="output/Ext.data.Connection.html#abort">Connection</a></td>\r
193     </tr>\r
194         <tr class="method-row inherited alt expandable">\r
195         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
196         <td class="sig">\r
197         <a id="Ext.Ajax-addEvents"></a>\r
198             <b>addEvents</b>(&nbsp;<code>Object object</code>&nbsp;) : void            <div class="mdesc">\r
199                         <div class="short">Used to define events on this Observable</div>\r
200             <div class="long">\r
201                 Used to define events on this Observable    <div class="mdetail-params">\r
202         <strong>Parameters:</strong>\r
203         <ul><li><code>object</code> : Object<div class="sub-desc">The object with the events defined</div></li>        </ul>\r
204         <strong>Returns:</strong>\r
205         <ul>\r
206             <li><code>void</code></li>\r
207         </ul>\r
208     </div>\r
209                 </div>\r
210                         </div>\r
211         </td>\r
212         <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addEvents" href="output/Ext.util.Observable.html#addEvents">Observable</a></td>\r
213     </tr>\r
214         <tr class="method-row inherited expandable">\r
215         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
216         <td class="sig">\r
217         <a id="Ext.Ajax-addListener"></a>\r
218             <b>addListener</b>(&nbsp;<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span>&nbsp;) : void            <div class="mdesc">\r
219                         <div class="short">Appends an event handler to this component</div>\r
220             <div class="long">\r
221                 Appends an event handler to this component    <div class="mdetail-params">\r
222         <strong>Parameters:</strong>\r
223         <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the handler
224 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration
225 properties. This may contain any of the following properties:<ul>
226 <li><b>scope</b> : Object<p class="sub-desc">The scope in which to execute the handler function. The handler function's "this" context.</p></li>
227 <li><b>delay</b> : Number<p class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</p></li>
228 <li><b>single</b> : Boolean<p class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</p></li>
229 <li><b>buffer</b> : Number<p class="sub-desc">Causes the handler to be scheduled to run in an <a ext:cls="Ext.util.DelayedTask" href="output/Ext.util.DelayedTask.html">Ext.util.DelayedTask</a> delayed
230 by the specified number of milliseconds. If the event fires again within that time, the original
231 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</p></li>
232 </ul><br>
233 <p>
234 <b>Combining Options</b><br>
235 Using the options argument, it is possible to combine different types of listeners:<br>
236 <br>
237 A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
238 <pre><code>el.on(<em>'click'</em>, <b>this</b>.onClick, <b>this</b>, {
239     single: true,
240     delay: 100,
241     forumId: 4
242 });</code></pre>
243 <p>
244 <b>Attaching multiple handlers in 1 call</b><br>
245 The method also allows for a single argument to be passed which is a config object containing properties
246 which specify multiple handlers.
247 <p>
248 <pre><code>foo.on({
249     <em>'click'</em> : {
250         fn: <b>this</b>.onClick,
251         scope: <b>this</b>,
252         delay: 100
253     },
254     <em>'mouseover'</em> : {
255         fn: <b>this</b>.onMouseOver,
256         scope: <b>this</b>
257     },
258     <em>'mouseout'</em> : {
259         fn: <b>this</b>.onMouseOut,
260         scope: <b>this</b>
261     }
262 });</code></pre>
263 <p>
264 Or a shorthand syntax:<br>
265 <pre><code>foo.on({
266     <em>'click'</em> : <b>this</b>.onClick,
267     <em>'mouseover'</em> : <b>this</b>.onMouseOver,
268     <em>'mouseout'</em> : <b>this</b>.onMouseOut,
269      scope: <b>this</b>
270 });</code></pre></div></li>        </ul>\r
271         <strong>Returns:</strong>\r
272         <ul>\r
273             <li><code>void</code></li>\r
274         </ul>\r
275     </div>\r
276                 </div>\r
277                         </div>\r
278         </td>\r
279         <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addListener" href="output/Ext.util.Observable.html#addListener">Observable</a></td>\r
280     </tr>\r
281         <tr class="method-row inherited alt expandable">\r
282         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
283         <td class="sig">\r
284         <a id="Ext.Ajax-fireEvent"></a>\r
285             <b>fireEvent</b>(&nbsp;<code>String eventName</code>, <code>Object... args</code>&nbsp;) : Boolean            <div class="mdesc">\r
286                         <div class="short">Fires the specified event with the passed parameters (minus the event name).</div>\r
287             <div class="long">\r
288                 Fires the specified event with the passed parameters (minus the event name).    <div class="mdetail-params">\r
289         <strong>Parameters:</strong>\r
290         <ul><li><code>eventName</code> : String<div class="sub-desc"></div></li><li><code>args</code> : Object...<div class="sub-desc">Variable number of parameters are passed to handlers</div></li>        </ul>\r
291         <strong>Returns:</strong>\r
292         <ul>\r
293             <li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>\r
294         </ul>\r
295     </div>\r
296                 </div>\r
297                         </div>\r
298         </td>\r
299         <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#fireEvent" href="output/Ext.util.Observable.html#fireEvent">Observable</a></td>\r
300     </tr>\r
301         <tr class="method-row inherited expandable">\r
302         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
303         <td class="sig">\r
304         <a id="Ext.Ajax-hasListener"></a>\r
305             <b>hasListener</b>(&nbsp;<code>String eventName</code>&nbsp;) : Boolean            <div class="mdesc">\r
306                         <div class="short">Checks to see if this object has any listeners for a specified event</div>\r
307             <div class="long">\r
308                 Checks to see if this object has any listeners for a specified event    <div class="mdetail-params">\r
309         <strong>Parameters:</strong>\r
310         <ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li>        </ul>\r
311         <strong>Returns:</strong>\r
312         <ul>\r
313             <li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li>\r
314         </ul>\r
315     </div>\r
316                 </div>\r
317                         </div>\r
318         </td>\r
319         <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#hasListener" href="output/Ext.util.Observable.html#hasListener">Observable</a></td>\r
320     </tr>\r
321         <tr class="method-row inherited alt expandable">\r
322         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
323         <td class="sig">\r
324         <a id="Ext.Ajax-isLoading"></a>\r
325             <b>isLoading</b>(&nbsp;<span class="optional" title="Optional">[<code>Number transactionId</code>]</span>&nbsp;) : Boolean            <div class="mdesc">\r
326                         <div class="short">Determine whether this object has a request outstanding.</div>\r
327             <div class="long">\r
328                 Determine whether this object has a request outstanding.    <div class="mdetail-params">\r
329         <strong>Parameters:</strong>\r
330         <ul><li><code>transactionId</code> : Number<div class="sub-desc">(Optional) defaults to the last transaction</div></li>        </ul>\r
331         <strong>Returns:</strong>\r
332         <ul>\r
333             <li><code>Boolean</code><div class="sub-desc">True if there is an outstanding request.</div></li>\r
334         </ul>\r
335     </div>\r
336                 </div>\r
337                         </div>\r
338         </td>\r
339         <td class="msource"><a ext:cls="Ext.data.Connection" ext:member="#isLoading" href="output/Ext.data.Connection.html#isLoading">Connection</a></td>\r
340     </tr>\r
341         <tr class="method-row inherited expandable">\r
342         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
343         <td class="sig">\r
344         <a id="Ext.Ajax-on"></a>\r
345             <b>on</b>(&nbsp;<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span>&nbsp;) : void            <div class="mdesc">\r
346                         <div class="short">Appends an event handler to this element (shorthand for addListener)</div>\r
347             <div class="long">\r
348                 Appends an event handler to this element (shorthand for addListener)    <div class="mdetail-params">\r
349         <strong>Parameters:</strong>\r
350         <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope in which to execute the handler
351 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional)</div></li>        </ul>\r
352         <strong>Returns:</strong>\r
353         <ul>\r
354             <li><code>void</code></li>\r
355         </ul>\r
356     </div>\r
357                 </div>\r
358                         </div>\r
359         </td>\r
360         <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#on" href="output/Ext.util.Observable.html#on">Observable</a></td>\r
361     </tr>\r
362         <tr class="method-row inherited alt expandable">\r
363         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
364         <td class="sig">\r
365         <a id="Ext.Ajax-purgeListeners"></a>\r
366             <b>purgeListeners</b>() : void            <div class="mdesc">\r
367                         <div class="short">Removes all listeners for this object</div>\r
368             <div class="long">\r
369                 Removes all listeners for this object    <div class="mdetail-params">\r
370         <strong>Parameters:</strong>\r
371         <ul><li>None.</li>        </ul>\r
372         <strong>Returns:</strong>\r
373         <ul>\r
374             <li><code>void</code></li>\r
375         </ul>\r
376     </div>\r
377                 </div>\r
378                         </div>\r
379         </td>\r
380         <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#purgeListeners" href="output/Ext.util.Observable.html#purgeListeners">Observable</a></td>\r
381     </tr>\r
382         <tr class="method-row inherited expandable">\r
383         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
384         <td class="sig">\r
385         <a id="Ext.Ajax-relayEvents"></a>\r
386             <b>relayEvents</b>(&nbsp;<code>Object o</code>, <code>Array events</code>&nbsp;) : void            <div class="mdesc">\r
387                         <div class="short">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.</div>\r
388             <div class="long">\r
389                 Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.    <div class="mdetail-params">\r
390         <strong>Parameters:</strong>\r
391         <ul><li><code>o</code> : Object<div class="sub-desc">The Observable whose events this object is to relay.</div></li><li><code>events</code> : Array<div class="sub-desc">Array of event names to relay.</div></li>        </ul>\r
392         <strong>Returns:</strong>\r
393         <ul>\r
394             <li><code>void</code></li>\r
395         </ul>\r
396     </div>\r
397                 </div>\r
398                         </div>\r
399         </td>\r
400         <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#relayEvents" href="output/Ext.util.Observable.html#relayEvents">Observable</a></td>\r
401     </tr>\r
402         <tr class="method-row inherited alt expandable">\r
403         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
404         <td class="sig">\r
405         <a id="Ext.Ajax-removeListener"></a>\r
406             <b>removeListener</b>(&nbsp;<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>&nbsp;) : void            <div class="mdesc">\r
407                         <div class="short">Removes a listener</div>\r
408             <div class="long">\r
409                 Removes a listener    <div class="mdetail-params">\r
410         <strong>Parameters:</strong>\r
411         <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li>        </ul>\r
412         <strong>Returns:</strong>\r
413         <ul>\r
414             <li><code>void</code></li>\r
415         </ul>\r
416     </div>\r
417                 </div>\r
418                         </div>\r
419         </td>\r
420         <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#removeListener" href="output/Ext.util.Observable.html#removeListener">Observable</a></td>\r
421     </tr>\r
422         <tr class="method-row inherited expandable">\r
423         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
424         <td class="sig">\r
425         <a id="Ext.Ajax-request"></a>\r
426             <b>request</b>(&nbsp;<span class="optional" title="Optional">[<code>Object options</code>]</span>&nbsp;) : Number            <div class="mdesc">\r
427                         <div class="short">Sends an HTTP request to a remote server.
428 Important: Ajax server requests are asynchronous, and this call will
429 return...</div>\r
430             <div class="long">\r
431                 <p>Sends an HTTP request to a remote server.</p>
432 <p><b>Important:</b> Ajax server requests are asynchronous, and this call will
433 return before the response has been received. Process any returned data
434 in a callback function.</p>
435 <p>To execute a callback function in the correct scope, use the <tt>scope</tt> option.</p>    <div class="mdetail-params">\r
436         <strong>Parameters:</strong>\r
437         <ul><li><code>options</code> : Object<div class="sub-desc">An object which may contain the following properties:<ul>
438 <li><b>url</b> : String/Function (Optional)<div class="sub-desc">The URL to
439 which to send the request, or a function to call which returns a URL string. The scope of the
440 function is specified by the <tt>scope</tt> option. Defaults to configured URL.</div></li>
441 <li><b>params</b> : Object/String/Function (Optional)<div class="sub-desc">
442 An object containing properties which are used as parameters to the
443 request, a url encoded string or a function to call to get either. The scope of the function
444 is specified by the <tt>scope</tt> option.</div></li>
445 <li><b>method</b> : String (Optional)<div class="sub-desc">The HTTP method to use
446 for the request. Defaults to the configured method, or if no method was configured,
447 "GET" if no parameters are being sent, and "POST" if parameters are being sent. Note that
448 the method name is case-sensitive and should be all caps.</div></li>
449 <li><b>callback</b> : Function (Optional)<div class="sub-desc">The
450 function to be called upon receipt of the HTTP response. The callback is
451 called regardless of success or failure and is passed the following
452 parameters:<ul>
453 <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>
454 <li><b>success</b> : Boolean<div class="sub-desc">True if the request succeeded.</div></li>
455 <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data. 
456 See <a href="http://www.w3.org/TR/XMLHttpRequest/">http://www.w3.org/TR/XMLHttpRequest/</a> for details about 
457 accessing elements of the response.</div></li>
458 </ul></div></li>
459 <li><a id="request-option-success"></a><b>success</b> : Function (Optional)<div class="sub-desc">The function
460 to be called upon success of the request. The callback is passed the following
461 parameters:<ul>
462 <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.</div></li>
463 <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>
464 </ul></div></li>
465 <li><b>failure</b> : Function (Optional)<div class="sub-desc">The function
466 to be called upon failure of the request. The callback is passed the
467 following parameters:<ul>
468 <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.</div></li>
469 <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>
470 </ul></div></li>
471 <li><b>scope</b> : Object (Optional)<div class="sub-desc">The scope in
472 which to execute the callbacks: The "this" object for the callback function. If the <tt>url</tt>, or <tt>params</tt> options were
473 specified as functions from which to draw values, then this also serves as the scope for those function calls.
474 Defaults to the browser window.</div></li>
475 <li><b>form</b> : Element/HTMLElement/String (Optional)<div class="sub-desc">The <tt>&lt;form&gt;</tt>
476 Element or the id of the <tt>&lt;form&gt;</tt> to pull parameters from.</div></li>
477 <li><a id="request-option-isUpload"></a><b>isUpload</b> : Boolean (Optional)<div class="sub-desc"><b>Only meaningful when used 
478 with the <tt>form</tt> option.</b>
479 <p>True if the form object is a file upload (will be set automatically if the form was
480 configured with <b><tt>enctype</tt></b> "multipart/form-data").</p>
481 <p>File uploads are not performed using normal "Ajax" techniques, that is they are <b>not</b>
482 performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
483 DOM <tt>&lt;form></tt> element temporarily modified to have its
484 <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
485 to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document
486 but removed after the return data has been gathered.</p>
487 <p>The server response is parsed by the browser to create the document for the IFRAME. If the
488 server is using JSON to send the return object, then the
489 <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
490 must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
491 <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
492 is created containing a <tt>responseText</tt> property in order to conform to the
493 requirements of event handlers and callbacks.</p>
494 <p>Be aware that file upload packets are sent with the content type <a href="http://www.faqs.org/rfcs/rfc2388.html">multipart/form</a>
495 and some server technologies (notably JEE) may require some custom processing in order to
496 retrieve parameter names and parameter values from the packet content.</p>
497 </div></li>
498 <li><b>headers</b> : Object (Optional)<div class="sub-desc">Request
499 headers to set for the request.</div></li>
500 <li><b>xmlData</b> : Object (Optional)<div class="sub-desc">XML document
501 to use for the post. Note: This will be used instead of params for the post
502 data. Any params will be appended to the URL.</div></li>
503 <li><b>jsonData</b> : Object/String (Optional)<div class="sub-desc">JSON
504 data to use as the post. Note: This will be used instead of params for the post
505 data. Any params will be appended to the URL.</div></li>
506 <li><b>disableCaching</b> : Boolean (Optional)<div class="sub-desc">True
507 to add a unique cache-buster param to GET requests.</div></li>
508 </ul></p>
509 <p>The options object may also contain any other property which might be needed to perform
510 postprocessing in a callback because it is passed to callback functions.</p></div></li>        </ul>\r
511         <strong>Returns:</strong>\r
512         <ul>\r
513             <li><code>Number</code><div class="sub-desc">transactionId The id of the server transaction. This may be used to cancel the request.</div></li>\r
514         </ul>\r
515     </div>\r
516                 </div>\r
517                         </div>\r
518         </td>\r
519         <td class="msource"><a ext:cls="Ext.data.Connection" ext:member="#request" href="output/Ext.data.Connection.html#request">Connection</a></td>\r
520     </tr>\r
521         <tr class="method-row inherited alt expandable">\r
522         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
523         <td class="sig">\r
524         <a id="Ext.Ajax-resumeEvents"></a>\r
525             <b>resumeEvents</b>() : void            <div class="mdesc">\r
526                         <div class="short">Resume firing events. (see <a ext:cls="Ext.util.Observable" ext:member="suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">suspendEvents</a>)</div>\r
527             <div class="long">\r
528                 Resume firing events. (see <a ext:cls="Ext.util.Observable" ext:member="suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">suspendEvents</a>)    <div class="mdetail-params">\r
529         <strong>Parameters:</strong>\r
530         <ul><li>None.</li>        </ul>\r
531         <strong>Returns:</strong>\r
532         <ul>\r
533             <li><code>void</code></li>\r
534         </ul>\r
535     </div>\r
536                 </div>\r
537                         </div>\r
538         </td>\r
539         <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">Observable</a></td>\r
540     </tr>\r
541         <tr class="method-row expandable">\r
542         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
543         <td class="sig">\r
544         <a id="Ext.Ajax-serializeForm"></a>\r
545             <b>serializeForm</b>(&nbsp;<code>String/HTMLElement form</code>&nbsp;) : String            <div class="mdesc">\r
546                         <div class="short">Serialize the passed form into a url encoded string</div>\r
547             <div class="long">\r
548                 Serialize the passed form into a url encoded string    <div class="mdetail-params">\r
549         <strong>Parameters:</strong>\r
550         <ul><li><code>form</code> : String/HTMLElement<div class="sub-desc"></div></li>        </ul>\r
551         <strong>Returns:</strong>\r
552         <ul>\r
553             <li><code>String</code></li>\r
554         </ul>\r
555     </div>\r
556                 </div>\r
557                         </div>\r
558         </td>\r
559         <td class="msource">Ajax</td>\r
560     </tr>\r
561         <tr class="method-row inherited alt expandable">\r
562         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
563         <td class="sig">\r
564         <a id="Ext.Ajax-suspendEvents"></a>\r
565             <b>suspendEvents</b>() : void            <div class="mdesc">\r
566                         <div class="short">Suspend the firing of all events. (see <a ext:cls="Ext.util.Observable" ext:member="resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">resumeEvents</a>)</div>\r
567             <div class="long">\r
568                 Suspend the firing of all events. (see <a ext:cls="Ext.util.Observable" ext:member="resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">resumeEvents</a>)    <div class="mdetail-params">\r
569         <strong>Parameters:</strong>\r
570         <ul><li>None.</li>        </ul>\r
571         <strong>Returns:</strong>\r
572         <ul>\r
573             <li><code>void</code></li>\r
574         </ul>\r
575     </div>\r
576                 </div>\r
577                         </div>\r
578         </td>\r
579         <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">Observable</a></td>\r
580     </tr>\r
581         <tr class="method-row inherited expandable">\r
582         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
583         <td class="sig">\r
584         <a id="Ext.Ajax-un"></a>\r
585             <b>un</b>(&nbsp;<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>&nbsp;) : void            <div class="mdesc">\r
586                         <div class="short">Removes a listener (shorthand for removeListener)</div>\r
587             <div class="long">\r
588                 Removes a listener (shorthand for removeListener)    <div class="mdetail-params">\r
589         <strong>Parameters:</strong>\r
590         <ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li>        </ul>\r
591         <strong>Returns:</strong>\r
592         <ul>\r
593             <li><code>void</code></li>\r
594         </ul>\r
595     </div>\r
596                 </div>\r
597                         </div>\r
598         </td>\r
599         <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#un" href="output/Ext.util.Observable.html#un">Observable</a></td>\r
600     </tr>\r
601             </table>
602                 <a id="Ext.Ajax-events"></a>
603         <h2>Public Events</h2>
604                 <table cellspacing="0" class="member-table">
605             <tr>
606                 <th class="sig-header" colspan="2">Event</th>
607                 <th class="msource-header">Defined By</th>
608             </tr>
609                 <tr class="event-row inherited expandable">\r
610         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
611         <td class="sig">\r
612         <a id="Ext.Ajax-beforerequest"></a>\r
613             <b>beforerequest</b> : (&nbsp;<code>Connection conn</code>, <code>Object options</code>&nbsp;)            <div class="mdesc">\r
614                         <div class="short">Fires before a network request is made to retrieve a data object.</div>\r
615             <div class="long">\r
616                 Fires before a network request is made to retrieve a data object.    <div class="mdetail-params">\r
617         <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>\r
618         <ul><li><code>conn</code> : Connection<div class="sub-desc">This Connection object.</div></li><li><code>options</code> : Object<div class="sub-desc">The options config object passed to the <a ext:cls="Ext.data.Connection" ext:member="request" href="output/Ext.data.Connection.html#request">request</a> method.</div></li>        </ul>\r
619     </div>\r
620                 </div>\r
621                         </div>\r
622         </td>\r
623         <td class="msource"><a ext:cls="Ext.data.Connection" ext:member="#event-beforerequest" href="output/Ext.data.Connection.html#event-beforerequest">Connection</a></td>\r
624     </tr>\r
625         <tr class="event-row inherited alt expandable">\r
626         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
627         <td class="sig">\r
628         <a id="Ext.Ajax-requestcomplete"></a>\r
629             <b>requestcomplete</b> : (&nbsp;<code>Connection conn</code>, <code>Object response</code>, <code>Object options</code>&nbsp;)            <div class="mdesc">\r
630                         <div class="short">Fires if the request was successfully completed.</div>\r
631             <div class="long">\r
632                 Fires if the request was successfully completed.    <div class="mdetail-params">\r
633         <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>\r
634         <ul><li><code>conn</code> : Connection<div class="sub-desc">This Connection object.</div></li><li><code>response</code> : Object<div class="sub-desc">The XHR object containing the response data.
635 See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>
636 for details.</div></li><li><code>options</code> : Object<div class="sub-desc">The options config object passed to the <a ext:cls="Ext.data.Connection" ext:member="request" href="output/Ext.data.Connection.html#request">request</a> method.</div></li>        </ul>\r
637     </div>\r
638                 </div>\r
639                         </div>\r
640         </td>\r
641         <td class="msource"><a ext:cls="Ext.data.Connection" ext:member="#event-requestcomplete" href="output/Ext.data.Connection.html#event-requestcomplete">Connection</a></td>\r
642     </tr>\r
643         <tr class="event-row inherited expandable">\r
644         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
645         <td class="sig">\r
646         <a id="Ext.Ajax-requestexception"></a>\r
647             <b>requestexception</b> : (&nbsp;<code>Connection conn</code>, <code>Object response</code>, <code>Object options</code>&nbsp;)            <div class="mdesc">\r
648                         <div class="short">Fires if an error HTTP status was returned from the server.
649 See HTTP Status Code Definitions
650 for details of HTTP stat...</div>\r
651             <div class="long">\r
652                 Fires if an error HTTP status was returned from the server.
653 See <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP Status Code Definitions</a>
654 for details of HTTP status codes.    <div class="mdetail-params">\r
655         <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>\r
656         <ul><li><code>conn</code> : Connection<div class="sub-desc">This Connection object.</div></li><li><code>response</code> : Object<div class="sub-desc">The XHR object containing the response data.
657 See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>
658 for details.</div></li><li><code>options</code> : Object<div class="sub-desc">The options config object passed to the <a ext:cls="Ext.data.Connection" ext:member="request" href="output/Ext.data.Connection.html#request">request</a> method.</div></li>        </ul>\r
659     </div>\r
660                 </div>\r
661                         </div>\r
662         </td>\r
663         <td class="msource"><a ext:cls="Ext.data.Connection" ext:member="#event-requestexception" href="output/Ext.data.Connection.html#event-requestexception">Connection</a></td>\r
664     </tr>\r
665             </table>
666         
667         </div>