source: trunk/web/addons/job_monarch/lib/extjs/docs/output/Ext.Ajax.html @ 619

Last change on this file since 619 was 619, checked in by ramonb, 15 years ago

lib/:

  • added new AJAX dependancies: ExtJS, pChart, Lightbox2
File size: 39.6 KB
Line 
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>
23Ext.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>
34Ext.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>
40Ext.Ajax.defaultHeaders = {
41    <em>'Powered-By'</em>: <em>'Ext'</em>
42};
43
44<i>// Global Ajax events can be handled on every request!</i>
45Ext.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">
56        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
57        <td class="sig">
58        <a id="Ext.Ajax-disableCachingParam"></a>
59            <b>disableCachingParam</b> : String            <div class="mdesc">
60                            (Optional) Change the parameter which is sent went disabling caching through a cache buster. Defaults to '_dc'                        </div>
61        </td>
62        <td class="msource"><a ext:cls="Ext.data.Connection" ext:member="#disableCachingParam" href="output/Ext.data.Connection.html#disableCachingParam">Connection</a></td>
63    </tr>
64        <tr class="config-row inherited alt expandable">
65        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
66        <td class="sig">
67        <a id="Ext.Ajax-listeners"></a>
68            <b>listeners</b> : Object            <div class="mdesc">
69                        <div class="short">(optional) A config object containing one or more event handlers to be added to this object during initialization. Th...</div>
70            <div class="long">
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>
72                        </div>
73        </td>
74        <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#listeners" href="output/Ext.util.Observable.html#listeners">Observable</a></td>
75    </tr>
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">
85        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
86        <td class="sig">
87        <a id="Ext.Ajax-autoAbort"></a>
88            <b>autoAbort</b> : Boolean            <div class="mdesc">
89                           
90Whether a new request should abort any pending requests. (defaults to false)                        </div>
91        </td>
92        <td class="msource">Ajax</td>
93    </tr>
94        <tr class="property-row alt">
95        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
96        <td class="sig">
97        <a id="Ext.Ajax-defaultHeaders"></a>
98            <b>defaultHeaders</b> : Object            <div class="mdesc">
99                           
100An object containing request headers which are added to each request made by this object. (defaults to undefined)                        </div>
101        </td>
102        <td class="msource">Ajax</td>
103    </tr>
104        <tr class="property-row">
105        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
106        <td class="sig">
107        <a id="Ext.Ajax-disableCaching"></a>
108            <b>disableCaching</b> : Boolean            <div class="mdesc">
109                           
110True to add a unique cache-buster param to GET requests. (defaults to true)                        </div>
111        </td>
112        <td class="msource">Ajax</td>
113    </tr>
114        <tr class="property-row alt expandable">
115        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
116        <td class="sig">
117        <a id="Ext.Ajax-extraParams"></a>
118            <b>extraParams</b> : Object            <div class="mdesc">
119                        <div class="short">
120An object containing properties which are used as
121extra parameters to each request made by this object. (defaults to...</div>
122            <div class="long">
123               
124An object containing properties which are used as
125extra parameters to each request made by this object. (defaults to undefined)            </div>
126                        </div>
127        </td>
128        <td class="msource">Ajax</td>
129    </tr>
130        <tr class="property-row expandable">
131        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
132        <td class="sig">
133        <a id="Ext.Ajax-method"></a>
134            <b>method</b> : String            <div class="mdesc">
135                        <div class="short">
136The default HTTP method to be used for requests. Note that this is case-sensitive and should be all caps (defaults
137t...</div>
138            <div class="long">
139               
140The default HTTP method to be used for requests. Note that this is case-sensitive and should be all caps (defaults
141to undefined; if not set but parms are present will use "POST," otherwise "GET.")            </div>
142                        </div>
143        </td>
144        <td class="msource">Ajax</td>
145    </tr>
146        <tr class="property-row alt">
147        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
148        <td class="sig">
149        <a id="Ext.Ajax-timeout"></a>
150            <b>timeout</b> : Number            <div class="mdesc">
151                           
152The timeout in milliseconds to be used for requests. (defaults to 30000)                        </div>
153        </td>
154        <td class="msource">Ajax</td>
155    </tr>
156        <tr class="property-row">
157        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
158        <td class="sig">
159        <a id="Ext.Ajax-url"></a>
160            <b>url</b> : String            <div class="mdesc">
161                           
162The default URL to be used for requests to the server. (defaults to undefined)                        </div>
163        </td>
164        <td class="msource">Ajax</td>
165    </tr>
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">
175        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
176        <td class="sig">
177        <a id="Ext.Ajax-abort"></a>
178            <b>abort</b>(&nbsp;<span class="optional" title="Optional">[<code>Number transactionId</code>]</span>&nbsp;) : void            <div class="mdesc">
179                        <div class="short">Aborts any outstanding request.</div>
180            <div class="long">
181                Aborts any outstanding request.    <div class="mdetail-params">
182        <strong>Parameters:</strong>
183        <ul><li><code>transactionId</code> : Number<div class="sub-desc">(Optional) defaults to the last transaction</div></li>        </ul>
184        <strong>Returns:</strong>
185        <ul>
186            <li><code>void</code></li>
187        </ul>
188    </div>
189                </div>
190                        </div>
191        </td>
192        <td class="msource"><a ext:cls="Ext.data.Connection" ext:member="#abort" href="output/Ext.data.Connection.html#abort">Connection</a></td>
193    </tr>
194        <tr class="method-row inherited alt expandable">
195        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
196        <td class="sig">
197        <a id="Ext.Ajax-addEvents"></a>
198            <b>addEvents</b>(&nbsp;<code>Object object</code>&nbsp;) : void            <div class="mdesc">
199                        <div class="short">Used to define events on this Observable</div>
200            <div class="long">
201                Used to define events on this Observable    <div class="mdetail-params">
202        <strong>Parameters:</strong>
203        <ul><li><code>object</code> : Object<div class="sub-desc">The object with the events defined</div></li>        </ul>
204        <strong>Returns:</strong>
205        <ul>
206            <li><code>void</code></li>
207        </ul>
208    </div>
209                </div>
210                        </div>
211        </td>
212        <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addEvents" href="output/Ext.util.Observable.html#addEvents">Observable</a></td>
213    </tr>
214        <tr class="method-row inherited expandable">
215        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
216        <td class="sig">
217        <a id="Ext.Ajax-addListener"></a>
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">
219                        <div class="short">Appends an event handler to this component</div>
220            <div class="long">
221                Appends an event handler to this component    <div class="mdetail-params">
222        <strong>Parameters:</strong>
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
224function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration
225properties. 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
230by the specified number of milliseconds. If the event fires again within that time, the original
231handler 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>
235Using the options argument, it is possible to combine different types of listeners:<br>
236<br>
237A 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>
245The method also allows for a single argument to be passed which is a config object containing properties
246which 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>
264Or 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>
271        <strong>Returns:</strong>
272        <ul>
273            <li><code>void</code></li>
274        </ul>
275    </div>
276                </div>
277                        </div>
278        </td>
279        <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addListener" href="output/Ext.util.Observable.html#addListener">Observable</a></td>
280    </tr>
281        <tr class="method-row inherited alt expandable">
282        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
283        <td class="sig">
284        <a id="Ext.Ajax-fireEvent"></a>
285            <b>fireEvent</b>(&nbsp;<code>String eventName</code>, <code>Object... args</code>&nbsp;) : Boolean            <div class="mdesc">
286                        <div class="short">Fires the specified event with the passed parameters (minus the event name).</div>
287            <div class="long">
288                Fires the specified event with the passed parameters (minus the event name).    <div class="mdetail-params">
289        <strong>Parameters:</strong>
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>
291        <strong>Returns:</strong>
292        <ul>
293            <li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>
294        </ul>
295    </div>
296                </div>
297                        </div>
298        </td>
299        <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#fireEvent" href="output/Ext.util.Observable.html#fireEvent">Observable</a></td>
300    </tr>
301        <tr class="method-row inherited expandable">
302        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
303        <td class="sig">
304        <a id="Ext.Ajax-hasListener"></a>
305            <b>hasListener</b>(&nbsp;<code>String eventName</code>&nbsp;) : Boolean            <div class="mdesc">
306                        <div class="short">Checks to see if this object has any listeners for a specified event</div>
307            <div class="long">
308                Checks to see if this object has any listeners for a specified event    <div class="mdetail-params">
309        <strong>Parameters:</strong>
310        <ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li>        </ul>
311        <strong>Returns:</strong>
312        <ul>
313            <li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li>
314        </ul>
315    </div>
316                </div>
317                        </div>
318        </td>
319        <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#hasListener" href="output/Ext.util.Observable.html#hasListener">Observable</a></td>
320    </tr>
321        <tr class="method-row inherited alt expandable">
322        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
323        <td class="sig">
324        <a id="Ext.Ajax-isLoading"></a>
325            <b>isLoading</b>(&nbsp;<span class="optional" title="Optional">[<code>Number transactionId</code>]</span>&nbsp;) : Boolean            <div class="mdesc">
326                        <div class="short">Determine whether this object has a request outstanding.</div>
327            <div class="long">
328                Determine whether this object has a request outstanding.    <div class="mdetail-params">
329        <strong>Parameters:</strong>
330        <ul><li><code>transactionId</code> : Number<div class="sub-desc">(Optional) defaults to the last transaction</div></li>        </ul>
331        <strong>Returns:</strong>
332        <ul>
333            <li><code>Boolean</code><div class="sub-desc">True if there is an outstanding request.</div></li>
334        </ul>
335    </div>
336                </div>
337                        </div>
338        </td>
339        <td class="msource"><a ext:cls="Ext.data.Connection" ext:member="#isLoading" href="output/Ext.data.Connection.html#isLoading">Connection</a></td>
340    </tr>
341        <tr class="method-row inherited expandable">
342        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
343        <td class="sig">
344        <a id="Ext.Ajax-on"></a>
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">
346                        <div class="short">Appends an event handler to this element (shorthand for addListener)</div>
347            <div class="long">
348                Appends an event handler to this element (shorthand for addListener)    <div class="mdetail-params">
349        <strong>Parameters:</strong>
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
351function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional)</div></li>        </ul>
352        <strong>Returns:</strong>
353        <ul>
354            <li><code>void</code></li>
355        </ul>
356    </div>
357                </div>
358                        </div>
359        </td>
360        <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#on" href="output/Ext.util.Observable.html#on">Observable</a></td>
361    </tr>
362        <tr class="method-row inherited alt expandable">
363        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
364        <td class="sig">
365        <a id="Ext.Ajax-purgeListeners"></a>
366            <b>purgeListeners</b>() : void            <div class="mdesc">
367                        <div class="short">Removes all listeners for this object</div>
368            <div class="long">
369                Removes all listeners for this object    <div class="mdetail-params">
370        <strong>Parameters:</strong>
371        <ul><li>None.</li>        </ul>
372        <strong>Returns:</strong>
373        <ul>
374            <li><code>void</code></li>
375        </ul>
376    </div>
377                </div>
378                        </div>
379        </td>
380        <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#purgeListeners" href="output/Ext.util.Observable.html#purgeListeners">Observable</a></td>
381    </tr>
382        <tr class="method-row inherited expandable">
383        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
384        <td class="sig">
385        <a id="Ext.Ajax-relayEvents"></a>
386            <b>relayEvents</b>(&nbsp;<code>Object o</code>, <code>Array events</code>&nbsp;) : void            <div class="mdesc">
387                        <div class="short">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.</div>
388            <div class="long">
389                Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.    <div class="mdetail-params">
390        <strong>Parameters:</strong>
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>
392        <strong>Returns:</strong>
393        <ul>
394            <li><code>void</code></li>
395        </ul>
396    </div>
397                </div>
398                        </div>
399        </td>
400        <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#relayEvents" href="output/Ext.util.Observable.html#relayEvents">Observable</a></td>
401    </tr>
402        <tr class="method-row inherited alt expandable">
403        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
404        <td class="sig">
405        <a id="Ext.Ajax-removeListener"></a>
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">
407                        <div class="short">Removes a listener</div>
408            <div class="long">
409                Removes a listener    <div class="mdetail-params">
410        <strong>Parameters:</strong>
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>
412        <strong>Returns:</strong>
413        <ul>
414            <li><code>void</code></li>
415        </ul>
416    </div>
417                </div>
418                        </div>
419        </td>
420        <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#removeListener" href="output/Ext.util.Observable.html#removeListener">Observable</a></td>
421    </tr>
422        <tr class="method-row inherited expandable">
423        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
424        <td class="sig">
425        <a id="Ext.Ajax-request"></a>
426            <b>request</b>(&nbsp;<span class="optional" title="Optional">[<code>Object options</code>]</span>&nbsp;) : Number            <div class="mdesc">
427                        <div class="short">Sends an HTTP request to a remote server.
428Important: Ajax server requests are asynchronous, and this call will
429return...</div>
430            <div class="long">
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
433return before the response has been received. Process any returned data
434in 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">
436        <strong>Parameters:</strong>
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
439which to send the request, or a function to call which returns a URL string. The scope of the
440function 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">
442An object containing properties which are used as parameters to the
443request, a url encoded string or a function to call to get either. The scope of the function
444is 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
446for 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
448the method name is case-sensitive and should be all caps.</div></li>
449<li><b>callback</b> : Function (Optional)<div class="sub-desc">The
450function to be called upon receipt of the HTTP response. The callback is
451called regardless of success or failure and is passed the following
452parameters:<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.
456See <a href="http://www.w3.org/TR/XMLHttpRequest/">http://www.w3.org/TR/XMLHttpRequest/</a> for details about
457accessing 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
460to be called upon success of the request. The callback is passed the following
461parameters:<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
466to be called upon failure of the request. The callback is passed the
467following 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
472which to execute the callbacks: The "this" object for the callback function. If the <tt>url</tt>, or <tt>params</tt> options were
473specified as functions from which to draw values, then this also serves as the scope for those function calls.
474Defaults 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>
476Element 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
478with 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
480configured 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>
482performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
483DOM <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
485to a dynamically generated, hidden <tt>&lt;iframe></tt> which is inserted into the document
486but 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
488server 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
490must 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
492is created containing a <tt>responseText</tt> property in order to conform to the
493requirements 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>
495and some server technologies (notably JEE) may require some custom processing in order to
496retrieve 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
499headers to set for the request.</div></li>
500<li><b>xmlData</b> : Object (Optional)<div class="sub-desc">XML document
501to use for the post. Note: This will be used instead of params for the post
502data. Any params will be appended to the URL.</div></li>
503<li><b>jsonData</b> : Object/String (Optional)<div class="sub-desc">JSON
504data to use as the post. Note: This will be used instead of params for the post
505data. Any params will be appended to the URL.</div></li>
506<li><b>disableCaching</b> : Boolean (Optional)<div class="sub-desc">True
507to 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
510postprocessing in a callback because it is passed to callback functions.</p></div></li>        </ul>
511        <strong>Returns:</strong>
512        <ul>
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>
514        </ul>
515    </div>
516                </div>
517                        </div>
518        </td>
519        <td class="msource"><a ext:cls="Ext.data.Connection" ext:member="#request" href="output/Ext.data.Connection.html#request">Connection</a></td>
520    </tr>
521        <tr class="method-row inherited alt expandable">
522        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
523        <td class="sig">
524        <a id="Ext.Ajax-resumeEvents"></a>
525            <b>resumeEvents</b>() : void            <div class="mdesc">
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>
527            <div class="long">
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">
529        <strong>Parameters:</strong>
530        <ul><li>None.</li>        </ul>
531        <strong>Returns:</strong>
532        <ul>
533            <li><code>void</code></li>
534        </ul>
535    </div>
536                </div>
537                        </div>
538        </td>
539        <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">Observable</a></td>
540    </tr>
541        <tr class="method-row expandable">
542        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
543        <td class="sig">
544        <a id="Ext.Ajax-serializeForm"></a>
545            <b>serializeForm</b>(&nbsp;<code>String/HTMLElement form</code>&nbsp;) : String            <div class="mdesc">
546                        <div class="short">Serialize the passed form into a url encoded string</div>
547            <div class="long">
548                Serialize the passed form into a url encoded string    <div class="mdetail-params">
549        <strong>Parameters:</strong>
550        <ul><li><code>form</code> : String/HTMLElement<div class="sub-desc"></div></li>        </ul>
551        <strong>Returns:</strong>
552        <ul>
553            <li><code>String</code></li>
554        </ul>
555    </div>
556                </div>
557                        </div>
558        </td>
559        <td class="msource">Ajax</td>
560    </tr>
561        <tr class="method-row inherited alt expandable">
562        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
563        <td class="sig">
564        <a id="Ext.Ajax-suspendEvents"></a>
565            <b>suspendEvents</b>() : void            <div class="mdesc">
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>
567            <div class="long">
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">
569        <strong>Parameters:</strong>
570        <ul><li>None.</li>        </ul>
571        <strong>Returns:</strong>
572        <ul>
573            <li><code>void</code></li>
574        </ul>
575    </div>
576                </div>
577                        </div>
578        </td>
579        <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">Observable</a></td>
580    </tr>
581        <tr class="method-row inherited expandable">
582        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
583        <td class="sig">
584        <a id="Ext.Ajax-un"></a>
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">
586                        <div class="short">Removes a listener (shorthand for removeListener)</div>
587            <div class="long">
588                Removes a listener (shorthand for removeListener)    <div class="mdetail-params">
589        <strong>Parameters:</strong>
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>
591        <strong>Returns:</strong>
592        <ul>
593            <li><code>void</code></li>
594        </ul>
595    </div>
596                </div>
597                        </div>
598        </td>
599        <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#un" href="output/Ext.util.Observable.html#un">Observable</a></td>
600    </tr>
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">
610        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
611        <td class="sig">
612        <a id="Ext.Ajax-beforerequest"></a>
613            <b>beforerequest</b> : (&nbsp;<code>Connection conn</code>, <code>Object options</code>&nbsp;)            <div class="mdesc">
614                        <div class="short">Fires before a network request is made to retrieve a data object.</div>
615            <div class="long">
616                Fires before a network request is made to retrieve a data object.    <div class="mdetail-params">
617        <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
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>
619    </div>
620                </div>
621                        </div>
622        </td>
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>
624    </tr>
625        <tr class="event-row inherited alt expandable">
626        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
627        <td class="sig">
628        <a id="Ext.Ajax-requestcomplete"></a>
629            <b>requestcomplete</b> : (&nbsp;<code>Connection conn</code>, <code>Object response</code>, <code>Object options</code>&nbsp;)            <div class="mdesc">
630                        <div class="short">Fires if the request was successfully completed.</div>
631            <div class="long">
632                Fires if the request was successfully completed.    <div class="mdetail-params">
633        <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
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.
635See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>
636for 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>
637    </div>
638                </div>
639                        </div>
640        </td>
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>
642    </tr>
643        <tr class="event-row inherited expandable">
644        <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
645        <td class="sig">
646        <a id="Ext.Ajax-requestexception"></a>
647            <b>requestexception</b> : (&nbsp;<code>Connection conn</code>, <code>Object response</code>, <code>Object options</code>&nbsp;)            <div class="mdesc">
648                        <div class="short">Fires if an error HTTP status was returned from the server.
649See HTTP Status Code Definitions
650for details of HTTP stat...</div>
651            <div class="long">
652                Fires if an error HTTP status was returned from the server.
653See <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP Status Code Definitions</a>
654for details of HTTP status codes.    <div class="mdetail-params">
655        <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
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.
657See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>
658for 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>
659    </div>
660                </div>
661                        </div>
662        </td>
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>
664    </tr>
665            </table>
666       
667        </div>
Note: See TracBrowser for help on using the repository browser.