1 <div class="body-wrap">
2 <div class="top-tools">
3 <a class="inner-link" href="#Ext.data.Connection-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4 <a class="inner-link" href="#Ext.data.Connection-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5 <a class="inner-link" href="#Ext.data.Connection-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6 <a class="inner-link" href="#Ext.data.Connection-configs"><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Options</a>
7 <a class="bookmark" href="../docs/?class=Ext.data.Connection"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a>
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"/>Connection</pre></div>
12 <h1>Class Ext.data.Connection</h1>
13 <table cellspacing="0">
14 <tr><td class="label">Package:</td><td class="hd-info">Ext.data</td></tr>
15 <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/Connection.js" target="_blank">Connection.js</a></td></tr>
16 <tr><td class="label">Class:</td><td class="hd-info">Connection</td></tr>
17 <tr><td class="label">Subclasses:</td><td class="hd-info"><a ext:cls="Ext.Ajax" href="output/Ext.Ajax.html">Ajax</a></td></tr>
18 <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.util.Observable" ext:member="" href="output/Ext.util.Observable.html">Observable</a></td></tr>
20 <div class="description">
22 <p>The class encapsulates a connection to the page's originating domain, allowing requests to be made
23 either to a configured URL, or to a URL specified at request time.</p>
24 <p>Requests made by this class are asynchronous, and will return immediately. No data from
25 the server will be available to the statement immediately following the <a ext:cls="Ext.data.Connection" ext:member="request" href="output/Ext.data.Connection.html#request">request</a> call.
26 To process returned data, use a
27 <a href="#request-option-success" ext:member="request-option-success" ext:cls="Ext.data.Connection">success callback</a>
28 in the request options object,
29 or an <a ext:cls="Ext.data.Connection" ext:member="requestcomplete" href="output/Ext.data.Connection.html#requestcomplete">event listener</a>.</p>
30 <p><h3>File Uploads</h3><a href="#request-option-isUpload" ext:member="request-option-isUpload" ext:cls="Ext.data.Connection">File uploads</a> are not performed using normal "Ajax" techniques, that
31 is they are <b>not</b> performed using XMLHttpRequests. Instead the form is submitted in the standard
32 manner with the DOM <tt><form></tt> element temporarily modified to have its
33 <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
34 to a dynamically generated, hidden <tt><iframe></tt> which is inserted into the document
35 but removed after the return data has been gathered.</p>
36 <p>The server response is parsed by the browser to create the document for the IFRAME. If the
37 server is using JSON to send the return object, then the
38 <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
39 must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
40 <p>Characters which are significant to an HTML parser must be sent as HTML entities, so encode
41 "<" as "&lt;", "&" as "&amp;" etc.</p>
42 <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
43 is created containing a <tt>responseText</tt> property in order to conform to the
44 requirements of event handlers and callbacks.</p>
45 <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>
46 and some server technologies (notably JEE) may require some custom processing in order to
47 retrieve parameter names and parameter values from the packet content.</p> </div>
49 <div class="hr"></div>
50 <a id="Ext.data.Connection-configs"></a>
51 <h2>Config Options</h2>
52 <table cellspacing="0" class="member-table">
54 <th class="sig-header" colspan="2">Config Options</th>
55 <th class="msource-header">Defined By</th>
57 <tr class="config-row">
\r
58 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
60 <a id="Ext.data.Connection-autoAbort"></a>
\r
61 <b>autoAbort</b> : Boolean <div class="mdesc">
\r
62 (Optional) Whether this request should abort any pending requests. (defaults to false) </div>
\r
64 <td class="msource">Connection</td>
\r
66 <tr class="config-row alt expandable">
\r
67 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
69 <a id="Ext.data.Connection-defaultHeaders"></a>
\r
70 <b>defaultHeaders</b> : Object <div class="mdesc">
\r
71 <div class="short">(Optional) An object containing request headers which are added to each request made by this object. (defaults to und...</div>
\r
73 (Optional) An object containing request headers which are added to each request made by this object. (defaults to undefined) </div>
\r
76 <td class="msource">Connection</td>
\r
78 <tr class="config-row">
\r
79 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
81 <a id="Ext.data.Connection-disableCaching"></a>
\r
82 <b>disableCaching</b> : Boolean <div class="mdesc">
\r
83 (Optional) True to add a unique cache-buster param to GET requests. (defaults to true) </div>
\r
85 <td class="msource">Connection</td>
\r
87 <tr class="config-row alt">
\r
88 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
90 <a id="Ext.data.Connection-disableCachingParam"></a>
\r
91 <b>disableCachingParam</b> : String <div class="mdesc">
\r
92 (Optional) Change the parameter which is sent went disabling caching through a cache buster. Defaults to '_dc' </div>
\r
94 <td class="msource">Connection</td>
\r
96 <tr class="config-row expandable">
\r
97 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
99 <a id="Ext.data.Connection-extraParams"></a>
\r
100 <b>extraParams</b> : Object <div class="mdesc">
\r
101 <div class="short">(Optional) An object containing properties which are used as extra parameters to each request made by this object. (d...</div>
\r
103 (Optional) An object containing properties which are used as extra parameters to each request made by this object. (defaults to undefined) </div>
\r
106 <td class="msource">Connection</td>
\r
108 <tr class="config-row inherited alt expandable">
\r
109 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
111 <a id="Ext.data.Connection-listeners"></a>
\r
112 <b>listeners</b> : Object <div class="mdesc">
\r
113 <div class="short">(optional) A config object containing one or more event handlers to be added to this object during initialization. Th...</div>
\r
115 (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
118 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#listeners" href="output/Ext.util.Observable.html#listeners">Observable</a></td>
\r
120 <tr class="config-row expandable">
\r
121 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
123 <a id="Ext.data.Connection-method"></a>
\r
124 <b>method</b> : String <div class="mdesc">
\r
125 <div class="short">(Optional) The default HTTP method to be used for requests. (defaults to undefined; if not set, but request params ar...</div>
\r
127 (Optional) The default HTTP method to be used for requests. (defaults to undefined; if not set, but <a ext:cls="Ext.data.Connection" ext:member="request" href="output/Ext.data.Connection.html#request">request</a> params are present, POST will be used; otherwise, GET will be used.) </div>
\r
130 <td class="msource">Connection</td>
\r
132 <tr class="config-row alt">
\r
133 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
135 <a id="Ext.data.Connection-timeout"></a>
\r
136 <b>timeout</b> : Number <div class="mdesc">
\r
137 (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000) </div>
\r
139 <td class="msource">Connection</td>
\r
141 <tr class="config-row">
\r
142 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
144 <a id="Ext.data.Connection-url"></a>
\r
145 <b>url</b> : String <div class="mdesc">
\r
146 (Optional) The default URL to be used for requests to the server. (defaults to undefined) </div>
\r
148 <td class="msource">Connection</td>
\r
151 <a id="Ext.data.Connection-props"></a>
152 <h2>Public Properties</h2>
153 <div class="no-members">This class has no public properties.</div> <a id="Ext.data.Connection-methods"></a>
154 <h2>Public Methods</h2>
155 <table cellspacing="0" class="member-table">
157 <th class="sig-header" colspan="2">Method</th>
158 <th class="msource-header">Defined By</th>
160 <tr class="method-row expandable">
\r
161 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
163 <a id="Ext.data.Connection-Connection"></a>
\r
164 <b>Connection</b>( <code>Object config</code> ) <div class="mdesc">
\r
165 <div class="short"></div>
\r
167 <div class="mdetail-params">
\r
168 <strong>Parameters:</strong>
\r
169 <ul><li><code>config</code> : Object<div class="sub-desc">a configuration object.</div></li> </ul>
\r
170 <strong>Returns:</strong>
\r
172 <li><code></code></li>
\r
178 <td class="msource">Connection</td>
\r
180 <tr class="method-row alt expandable">
\r
181 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
183 <a id="Ext.data.Connection-abort"></a>
\r
184 <b>abort</b>( <span class="optional" title="Optional">[<code>Number transactionId</code>]</span> ) : void <div class="mdesc">
\r
185 <div class="short">Aborts any outstanding request.</div>
\r
187 Aborts any outstanding request. <div class="mdetail-params">
\r
188 <strong>Parameters:</strong>
\r
189 <ul><li><code>transactionId</code> : Number<div class="sub-desc">(Optional) defaults to the last transaction</div></li> </ul>
\r
190 <strong>Returns:</strong>
\r
192 <li><code>void</code></li>
\r
198 <td class="msource">Connection</td>
\r
200 <tr class="method-row inherited expandable">
\r
201 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
203 <a id="Ext.data.Connection-addEvents"></a>
\r
204 <b>addEvents</b>( <code>Object object</code> ) : void <div class="mdesc">
\r
205 <div class="short">Used to define events on this Observable</div>
\r
207 Used to define events on this Observable <div class="mdetail-params">
\r
208 <strong>Parameters:</strong>
\r
209 <ul><li><code>object</code> : Object<div class="sub-desc">The object with the events defined</div></li> </ul>
\r
210 <strong>Returns:</strong>
\r
212 <li><code>void</code></li>
\r
218 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addEvents" href="output/Ext.util.Observable.html#addEvents">Observable</a></td>
\r
220 <tr class="method-row inherited alt expandable">
\r
221 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
223 <a id="Ext.data.Connection-addListener"></a>
\r
224 <b>addListener</b>( <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> ) : void <div class="mdesc">
\r
225 <div class="short">Appends an event handler to this component</div>
\r
227 Appends an event handler to this component <div class="mdetail-params">
\r
228 <strong>Parameters:</strong>
\r
229 <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
230 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration
231 properties. This may contain any of the following properties:<ul>
232 <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>
233 <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>
234 <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>
235 <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
236 by the specified number of milliseconds. If the event fires again within that time, the original
237 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</p></li>
240 <b>Combining Options</b><br>
241 Using the options argument, it is possible to combine different types of listeners:<br>
243 A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
244 <pre><code>el.on(<em>'click'</em>, <b>this</b>.onClick, <b>this</b>, {
250 <b>Attaching multiple handlers in 1 call</b><br>
251 The method also allows for a single argument to be passed which is a config object containing properties
252 which specify multiple handlers.
256 fn: <b>this</b>.onClick,
260 <em>'mouseover'</em> : {
261 fn: <b>this</b>.onMouseOver,
264 <em>'mouseout'</em> : {
265 fn: <b>this</b>.onMouseOut,
270 Or a shorthand syntax:<br>
272 <em>'click'</em> : <b>this</b>.onClick,
273 <em>'mouseover'</em> : <b>this</b>.onMouseOver,
274 <em>'mouseout'</em> : <b>this</b>.onMouseOut,
276 });</code></pre></div></li> </ul>
\r
277 <strong>Returns:</strong>
\r
279 <li><code>void</code></li>
\r
285 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addListener" href="output/Ext.util.Observable.html#addListener">Observable</a></td>
\r
287 <tr class="method-row inherited expandable">
\r
288 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
290 <a id="Ext.data.Connection-fireEvent"></a>
\r
291 <b>fireEvent</b>( <code>String eventName</code>, <code>Object... args</code> ) : Boolean <div class="mdesc">
\r
292 <div class="short">Fires the specified event with the passed parameters (minus the event name).</div>
\r
294 Fires the specified event with the passed parameters (minus the event name). <div class="mdetail-params">
\r
295 <strong>Parameters:</strong>
\r
296 <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
297 <strong>Returns:</strong>
\r
299 <li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>
\r
305 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#fireEvent" href="output/Ext.util.Observable.html#fireEvent">Observable</a></td>
\r
307 <tr class="method-row inherited alt expandable">
\r
308 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
310 <a id="Ext.data.Connection-hasListener"></a>
\r
311 <b>hasListener</b>( <code>String eventName</code> ) : Boolean <div class="mdesc">
\r
312 <div class="short">Checks to see if this object has any listeners for a specified event</div>
\r
314 Checks to see if this object has any listeners for a specified event <div class="mdetail-params">
\r
315 <strong>Parameters:</strong>
\r
316 <ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li> </ul>
\r
317 <strong>Returns:</strong>
\r
319 <li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li>
\r
325 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#hasListener" href="output/Ext.util.Observable.html#hasListener">Observable</a></td>
\r
327 <tr class="method-row expandable">
\r
328 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
330 <a id="Ext.data.Connection-isLoading"></a>
\r
331 <b>isLoading</b>( <span class="optional" title="Optional">[<code>Number transactionId</code>]</span> ) : Boolean <div class="mdesc">
\r
332 <div class="short">Determine whether this object has a request outstanding.</div>
\r
334 Determine whether this object has a request outstanding. <div class="mdetail-params">
\r
335 <strong>Parameters:</strong>
\r
336 <ul><li><code>transactionId</code> : Number<div class="sub-desc">(Optional) defaults to the last transaction</div></li> </ul>
\r
337 <strong>Returns:</strong>
\r
339 <li><code>Boolean</code><div class="sub-desc">True if there is an outstanding request.</div></li>
\r
345 <td class="msource">Connection</td>
\r
347 <tr class="method-row inherited alt expandable">
\r
348 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
350 <a id="Ext.data.Connection-on"></a>
\r
351 <b>on</b>( <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> ) : void <div class="mdesc">
\r
352 <div class="short">Appends an event handler to this element (shorthand for addListener)</div>
\r
354 Appends an event handler to this element (shorthand for addListener) <div class="mdetail-params">
\r
355 <strong>Parameters:</strong>
\r
356 <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
357 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional)</div></li> </ul>
\r
358 <strong>Returns:</strong>
\r
360 <li><code>void</code></li>
\r
366 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#on" href="output/Ext.util.Observable.html#on">Observable</a></td>
\r
368 <tr class="method-row inherited expandable">
\r
369 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
371 <a id="Ext.data.Connection-purgeListeners"></a>
\r
372 <b>purgeListeners</b>() : void <div class="mdesc">
\r
373 <div class="short">Removes all listeners for this object</div>
\r
375 Removes all listeners for this object <div class="mdetail-params">
\r
376 <strong>Parameters:</strong>
\r
377 <ul><li>None.</li> </ul>
\r
378 <strong>Returns:</strong>
\r
380 <li><code>void</code></li>
\r
386 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#purgeListeners" href="output/Ext.util.Observable.html#purgeListeners">Observable</a></td>
\r
388 <tr class="method-row inherited alt expandable">
\r
389 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
391 <a id="Ext.data.Connection-relayEvents"></a>
\r
392 <b>relayEvents</b>( <code>Object o</code>, <code>Array events</code> ) : void <div class="mdesc">
\r
393 <div class="short">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.</div>
\r
395 Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>. <div class="mdetail-params">
\r
396 <strong>Parameters:</strong>
\r
397 <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
398 <strong>Returns:</strong>
\r
400 <li><code>void</code></li>
\r
406 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#relayEvents" href="output/Ext.util.Observable.html#relayEvents">Observable</a></td>
\r
408 <tr class="method-row inherited expandable">
\r
409 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
411 <a id="Ext.data.Connection-removeListener"></a>
\r
412 <b>removeListener</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : void <div class="mdesc">
\r
413 <div class="short">Removes a listener</div>
\r
415 Removes a listener <div class="mdetail-params">
\r
416 <strong>Parameters:</strong>
\r
417 <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
418 <strong>Returns:</strong>
\r
420 <li><code>void</code></li>
\r
426 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#removeListener" href="output/Ext.util.Observable.html#removeListener">Observable</a></td>
\r
428 <tr class="method-row alt expandable">
\r
429 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
431 <a id="Ext.data.Connection-request"></a>
\r
432 <b>request</b>( <span class="optional" title="Optional">[<code>Object options</code>]</span> ) : Number <div class="mdesc">
\r
433 <div class="short">Sends an HTTP request to a remote server.
434 Important: Ajax server requests are asynchronous, and this call will
437 <p>Sends an HTTP request to a remote server.</p>
438 <p><b>Important:</b> Ajax server requests are asynchronous, and this call will
439 return before the response has been received. Process any returned data
440 in a callback function.</p>
441 <p>To execute a callback function in the correct scope, use the <tt>scope</tt> option.</p> <div class="mdetail-params">
\r
442 <strong>Parameters:</strong>
\r
443 <ul><li><code>options</code> : Object<div class="sub-desc">An object which may contain the following properties:<ul>
444 <li><b>url</b> : String/Function (Optional)<div class="sub-desc">The URL to
445 which to send the request, or a function to call which returns a URL string. The scope of the
446 function is specified by the <tt>scope</tt> option. Defaults to configured URL.</div></li>
447 <li><b>params</b> : Object/String/Function (Optional)<div class="sub-desc">
448 An object containing properties which are used as parameters to the
449 request, a url encoded string or a function to call to get either. The scope of the function
450 is specified by the <tt>scope</tt> option.</div></li>
451 <li><b>method</b> : String (Optional)<div class="sub-desc">The HTTP method to use
452 for the request. Defaults to the configured method, or if no method was configured,
453 "GET" if no parameters are being sent, and "POST" if parameters are being sent. Note that
454 the method name is case-sensitive and should be all caps.</div></li>
455 <li><b>callback</b> : Function (Optional)<div class="sub-desc">The
456 function to be called upon receipt of the HTTP response. The callback is
457 called regardless of success or failure and is passed the following
459 <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>
460 <li><b>success</b> : Boolean<div class="sub-desc">True if the request succeeded.</div></li>
461 <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.
462 See <a href="http://www.w3.org/TR/XMLHttpRequest/">http://www.w3.org/TR/XMLHttpRequest/</a> for details about
463 accessing elements of the response.</div></li>
465 <li><a id="request-option-success"></a><b>success</b> : Function (Optional)<div class="sub-desc">The function
466 to be called upon success of the request. The callback is passed the following
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>
471 <li><b>failure</b> : Function (Optional)<div class="sub-desc">The function
472 to be called upon failure of the request. The callback is passed the
473 following parameters:<ul>
474 <li><b>response</b> : Object<div class="sub-desc">The XMLHttpRequest object containing the response data.</div></li>
475 <li><b>options</b> : Object<div class="sub-desc">The parameter to the request call.</div></li>
477 <li><b>scope</b> : Object (Optional)<div class="sub-desc">The scope in
478 which to execute the callbacks: The "this" object for the callback function. If the <tt>url</tt>, or <tt>params</tt> options were
479 specified as functions from which to draw values, then this also serves as the scope for those function calls.
480 Defaults to the browser window.</div></li>
481 <li><b>form</b> : Element/HTMLElement/String (Optional)<div class="sub-desc">The <tt><form></tt>
482 Element or the id of the <tt><form></tt> to pull parameters from.</div></li>
483 <li><a id="request-option-isUpload"></a><b>isUpload</b> : Boolean (Optional)<div class="sub-desc"><b>Only meaningful when used
484 with the <tt>form</tt> option.</b>
485 <p>True if the form object is a file upload (will be set automatically if the form was
486 configured with <b><tt>enctype</tt></b> "multipart/form-data").</p>
487 <p>File uploads are not performed using normal "Ajax" techniques, that is they are <b>not</b>
488 performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
489 DOM <tt><form></tt> element temporarily modified to have its
490 <a href="http://www.w3.org/TR/REC-html40/present/frames.html#adef-target">target</a> set to refer
491 to a dynamically generated, hidden <tt><iframe></tt> which is inserted into the document
492 but removed after the return data has been gathered.</p>
493 <p>The server response is parsed by the browser to create the document for the IFRAME. If the
494 server is using JSON to send the return object, then the
495 <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">Content-Type</a> header
496 must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.</p>
497 <p>The response text is retrieved from the document, and a fake XMLHttpRequest object
498 is created containing a <tt>responseText</tt> property in order to conform to the
499 requirements of event handlers and callbacks.</p>
500 <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>
501 and some server technologies (notably JEE) may require some custom processing in order to
502 retrieve parameter names and parameter values from the packet content.</p>
504 <li><b>headers</b> : Object (Optional)<div class="sub-desc">Request
505 headers to set for the request.</div></li>
506 <li><b>xmlData</b> : Object (Optional)<div class="sub-desc">XML document
507 to use for the post. Note: This will be used instead of params for the post
508 data. Any params will be appended to the URL.</div></li>
509 <li><b>jsonData</b> : Object/String (Optional)<div class="sub-desc">JSON
510 data to use as the post. Note: This will be used instead of params for the post
511 data. Any params will be appended to the URL.</div></li>
512 <li><b>disableCaching</b> : Boolean (Optional)<div class="sub-desc">True
513 to add a unique cache-buster param to GET requests.</div></li>
515 <p>The options object may also contain any other property which might be needed to perform
516 postprocessing in a callback because it is passed to callback functions.</p></div></li> </ul>
\r
517 <strong>Returns:</strong>
\r
519 <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
525 <td class="msource">Connection</td>
\r
527 <tr class="method-row inherited expandable">
\r
528 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
530 <a id="Ext.data.Connection-resumeEvents"></a>
\r
531 <b>resumeEvents</b>() : void <div class="mdesc">
\r
532 <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
534 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
535 <strong>Parameters:</strong>
\r
536 <ul><li>None.</li> </ul>
\r
537 <strong>Returns:</strong>
\r
539 <li><code>void</code></li>
\r
545 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">Observable</a></td>
\r
547 <tr class="method-row inherited alt expandable">
\r
548 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
550 <a id="Ext.data.Connection-suspendEvents"></a>
\r
551 <b>suspendEvents</b>() : void <div class="mdesc">
\r
552 <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
554 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
555 <strong>Parameters:</strong>
\r
556 <ul><li>None.</li> </ul>
\r
557 <strong>Returns:</strong>
\r
559 <li><code>void</code></li>
\r
565 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">Observable</a></td>
\r
567 <tr class="method-row inherited expandable">
\r
568 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
570 <a id="Ext.data.Connection-un"></a>
\r
571 <b>un</b>( <code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span> ) : void <div class="mdesc">
\r
572 <div class="short">Removes a listener (shorthand for removeListener)</div>
\r
574 Removes a listener (shorthand for removeListener) <div class="mdetail-params">
\r
575 <strong>Parameters:</strong>
\r
576 <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
577 <strong>Returns:</strong>
\r
579 <li><code>void</code></li>
\r
585 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#un" href="output/Ext.util.Observable.html#un">Observable</a></td>
\r
588 <a id="Ext.data.Connection-events"></a>
589 <h2>Public Events</h2>
590 <table cellspacing="0" class="member-table">
592 <th class="sig-header" colspan="2">Event</th>
593 <th class="msource-header">Defined By</th>
595 <tr class="event-row expandable">
\r
596 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
598 <a id="Ext.data.Connection-beforerequest"></a>
\r
599 <b>beforerequest</b> : ( <code>Connection conn</code>, <code>Object options</code> ) <div class="mdesc">
\r
600 <div class="short">Fires before a network request is made to retrieve a data object.</div>
\r
602 Fires before a network request is made to retrieve a data object. <div class="mdetail-params">
\r
603 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
604 <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
609 <td class="msource">Connection</td>
\r
611 <tr class="event-row alt expandable">
\r
612 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
614 <a id="Ext.data.Connection-requestcomplete"></a>
\r
615 <b>requestcomplete</b> : ( <code>Connection conn</code>, <code>Object response</code>, <code>Object options</code> ) <div class="mdesc">
\r
616 <div class="short">Fires if the request was successfully completed.</div>
\r
618 Fires if the request was successfully completed. <div class="mdetail-params">
\r
619 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
620 <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.
621 See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>
622 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
627 <td class="msource">Connection</td>
\r
629 <tr class="event-row expandable">
\r
630 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
632 <a id="Ext.data.Connection-requestexception"></a>
\r
633 <b>requestexception</b> : ( <code>Connection conn</code>, <code>Object response</code>, <code>Object options</code> ) <div class="mdesc">
\r
634 <div class="short">Fires if an error HTTP status was returned from the server.
635 See HTTP Status Code Definitions
636 for details of HTTP stat...</div>
\r
638 Fires if an error HTTP status was returned from the server.
639 See <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">HTTP Status Code Definitions</a>
640 for details of HTTP status codes. <div class="mdetail-params">
\r
641 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
642 <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.
643 See <a href="http://www.w3.org/TR/XMLHttpRequest/">The XMLHttpRequest Object</a>
644 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
649 <td class="msource">Connection</td>
\r