commit extjs-2.2.1
[extjs.git] / docs / output / Ext.data.Connection.html
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>
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"/>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>
19                     </table>
20         <div class="description">
21             *
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>&lt;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>&lt;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 "&lt;" as "&amp;lt;", "&amp;" as "&amp;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>
48         
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">
53             <tr>
54                 <th class="sig-header" colspan="2">Config Options</th>
55                 <th class="msource-header">Defined By</th>
56             </tr>
57                 <tr class="config-row">\r
58         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
59         <td class="sig">\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
63         </td>\r
64         <td class="msource">Connection</td>\r
65     </tr>\r
66         <tr class="config-row alt expandable">\r
67         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
68         <td class="sig">\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
72             <div class="long">\r
73                 (Optional) An object containing request headers which are added to each request made by this object. (defaults to undefined)            </div>\r
74                         </div>\r
75         </td>\r
76         <td class="msource">Connection</td>\r
77     </tr>\r
78         <tr class="config-row">\r
79         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
80         <td class="sig">\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
84         </td>\r
85         <td class="msource">Connection</td>\r
86     </tr>\r
87         <tr class="config-row alt">\r
88         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
89         <td class="sig">\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
93         </td>\r
94         <td class="msource">Connection</td>\r
95     </tr>\r
96         <tr class="config-row expandable">\r
97         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
98         <td class="sig">\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
102             <div class="long">\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
104                         </div>\r
105         </td>\r
106         <td class="msource">Connection</td>\r
107     </tr>\r
108         <tr class="config-row inherited alt expandable">\r
109         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
110         <td class="sig">\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
114             <div class="long">\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
116                         </div>\r
117         </td>\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
119     </tr>\r
120         <tr class="config-row expandable">\r
121         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
122         <td class="sig">\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
126             <div class="long">\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
128                         </div>\r
129         </td>\r
130         <td class="msource">Connection</td>\r
131     </tr>\r
132         <tr class="config-row alt">\r
133         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
134         <td class="sig">\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
138         </td>\r
139         <td class="msource">Connection</td>\r
140     </tr>\r
141         <tr class="config-row">\r
142         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
143         <td class="sig">\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
147         </td>\r
148         <td class="msource">Connection</td>\r
149     </tr>\r
150             </table>
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">
156             <tr>
157                 <th class="sig-header" colspan="2">Method</th>
158                 <th class="msource-header">Defined By</th>
159             </tr>
160                 <tr class="method-row expandable">\r
161         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
162         <td class="sig">\r
163         <a id="Ext.data.Connection-Connection"></a>\r
164             <b>Connection</b>(&nbsp;<code>Object config</code>&nbsp;)            <div class="mdesc">\r
165                         <div class="short"></div>\r
166             <div class="long">\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
171         <ul>\r
172             <li><code></code></li>\r
173         </ul>\r
174     </div>\r
175                 </div>\r
176                         </div>\r
177         </td>\r
178         <td class="msource">Connection</td>\r
179     </tr>\r
180         <tr class="method-row alt expandable">\r
181         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
182         <td class="sig">\r
183         <a id="Ext.data.Connection-abort"></a>\r
184             <b>abort</b>(&nbsp;<span class="optional" title="Optional">[<code>Number transactionId</code>]</span>&nbsp;) : void            <div class="mdesc">\r
185                         <div class="short">Aborts any outstanding request.</div>\r
186             <div class="long">\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
191         <ul>\r
192             <li><code>void</code></li>\r
193         </ul>\r
194     </div>\r
195                 </div>\r
196                         </div>\r
197         </td>\r
198         <td class="msource">Connection</td>\r
199     </tr>\r
200         <tr class="method-row inherited expandable">\r
201         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
202         <td class="sig">\r
203         <a id="Ext.data.Connection-addEvents"></a>\r
204             <b>addEvents</b>(&nbsp;<code>Object object</code>&nbsp;) : void            <div class="mdesc">\r
205                         <div class="short">Used to define events on this Observable</div>\r
206             <div class="long">\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
211         <ul>\r
212             <li><code>void</code></li>\r
213         </ul>\r
214     </div>\r
215                 </div>\r
216                         </div>\r
217         </td>\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
219     </tr>\r
220         <tr class="method-row inherited alt expandable">\r
221         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
222         <td class="sig">\r
223         <a id="Ext.data.Connection-addListener"></a>\r
224             <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
225                         <div class="short">Appends an event handler to this component</div>\r
226             <div class="long">\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>
238 </ul><br>
239 <p>
240 <b>Combining Options</b><br>
241 Using the options argument, it is possible to combine different types of listeners:<br>
242 <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>, {
245     single: true,
246     delay: 100,
247     forumId: 4
248 });</code></pre>
249 <p>
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.
253 <p>
254 <pre><code>foo.on({
255     <em>'click'</em> : {
256         fn: <b>this</b>.onClick,
257         scope: <b>this</b>,
258         delay: 100
259     },
260     <em>'mouseover'</em> : {
261         fn: <b>this</b>.onMouseOver,
262         scope: <b>this</b>
263     },
264     <em>'mouseout'</em> : {
265         fn: <b>this</b>.onMouseOut,
266         scope: <b>this</b>
267     }
268 });</code></pre>
269 <p>
270 Or a shorthand syntax:<br>
271 <pre><code>foo.on({
272     <em>'click'</em> : <b>this</b>.onClick,
273     <em>'mouseover'</em> : <b>this</b>.onMouseOver,
274     <em>'mouseout'</em> : <b>this</b>.onMouseOut,
275      scope: <b>this</b>
276 });</code></pre></div></li>        </ul>\r
277         <strong>Returns:</strong>\r
278         <ul>\r
279             <li><code>void</code></li>\r
280         </ul>\r
281     </div>\r
282                 </div>\r
283                         </div>\r
284         </td>\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
286     </tr>\r
287         <tr class="method-row inherited expandable">\r
288         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
289         <td class="sig">\r
290         <a id="Ext.data.Connection-fireEvent"></a>\r
291             <b>fireEvent</b>(&nbsp;<code>String eventName</code>, <code>Object... args</code>&nbsp;) : Boolean            <div class="mdesc">\r
292                         <div class="short">Fires the specified event with the passed parameters (minus the event name).</div>\r
293             <div class="long">\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
298         <ul>\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
300         </ul>\r
301     </div>\r
302                 </div>\r
303                         </div>\r
304         </td>\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
306     </tr>\r
307         <tr class="method-row inherited alt expandable">\r
308         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
309         <td class="sig">\r
310         <a id="Ext.data.Connection-hasListener"></a>\r
311             <b>hasListener</b>(&nbsp;<code>String eventName</code>&nbsp;) : Boolean            <div class="mdesc">\r
312                         <div class="short">Checks to see if this object has any listeners for a specified event</div>\r
313             <div class="long">\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
318         <ul>\r
319             <li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li>\r
320         </ul>\r
321     </div>\r
322                 </div>\r
323                         </div>\r
324         </td>\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
326     </tr>\r
327         <tr class="method-row expandable">\r
328         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
329         <td class="sig">\r
330         <a id="Ext.data.Connection-isLoading"></a>\r
331             <b>isLoading</b>(&nbsp;<span class="optional" title="Optional">[<code>Number transactionId</code>]</span>&nbsp;) : Boolean            <div class="mdesc">\r
332                         <div class="short">Determine whether this object has a request outstanding.</div>\r
333             <div class="long">\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
338         <ul>\r
339             <li><code>Boolean</code><div class="sub-desc">True if there is an outstanding request.</div></li>\r
340         </ul>\r
341     </div>\r
342                 </div>\r
343                         </div>\r
344         </td>\r
345         <td class="msource">Connection</td>\r
346     </tr>\r
347         <tr class="method-row inherited alt expandable">\r
348         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
349         <td class="sig">\r
350         <a id="Ext.data.Connection-on"></a>\r
351             <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
352                         <div class="short">Appends an event handler to this element (shorthand for addListener)</div>\r
353             <div class="long">\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
359         <ul>\r
360             <li><code>void</code></li>\r
361         </ul>\r
362     </div>\r
363                 </div>\r
364                         </div>\r
365         </td>\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
367     </tr>\r
368         <tr class="method-row inherited expandable">\r
369         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
370         <td class="sig">\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
374             <div class="long">\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
379         <ul>\r
380             <li><code>void</code></li>\r
381         </ul>\r
382     </div>\r
383                 </div>\r
384                         </div>\r
385         </td>\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
387     </tr>\r
388         <tr class="method-row inherited alt expandable">\r
389         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
390         <td class="sig">\r
391         <a id="Ext.data.Connection-relayEvents"></a>\r
392             <b>relayEvents</b>(&nbsp;<code>Object o</code>, <code>Array events</code>&nbsp;) : 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
394             <div class="long">\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
399         <ul>\r
400             <li><code>void</code></li>\r
401         </ul>\r
402     </div>\r
403                 </div>\r
404                         </div>\r
405         </td>\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
407     </tr>\r
408         <tr class="method-row inherited expandable">\r
409         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
410         <td class="sig">\r
411         <a id="Ext.data.Connection-removeListener"></a>\r
412             <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
413                         <div class="short">Removes a listener</div>\r
414             <div class="long">\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
419         <ul>\r
420             <li><code>void</code></li>\r
421         </ul>\r
422     </div>\r
423                 </div>\r
424                         </div>\r
425         </td>\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
427     </tr>\r
428         <tr class="method-row alt expandable">\r
429         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
430         <td class="sig">\r
431         <a id="Ext.data.Connection-request"></a>\r
432             <b>request</b>(&nbsp;<span class="optional" title="Optional">[<code>Object options</code>]</span>&nbsp;) : 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
435 return...</div>\r
436             <div class="long">\r
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
458 parameters:<ul>
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>
464 </ul></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
467 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>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>
476 </ul></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>&lt;form&gt;</tt>
482 Element or the id of the <tt>&lt;form&gt;</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>&lt;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>&lt;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>
503 </div></li>
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>
514 </ul></p>
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
518         <ul>\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
520         </ul>\r
521     </div>\r
522                 </div>\r
523                         </div>\r
524         </td>\r
525         <td class="msource">Connection</td>\r
526     </tr>\r
527         <tr class="method-row inherited expandable">\r
528         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
529         <td class="sig">\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
533             <div class="long">\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
538         <ul>\r
539             <li><code>void</code></li>\r
540         </ul>\r
541     </div>\r
542                 </div>\r
543                         </div>\r
544         </td>\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
546     </tr>\r
547         <tr class="method-row inherited alt expandable">\r
548         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
549         <td class="sig">\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
553             <div class="long">\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
558         <ul>\r
559             <li><code>void</code></li>\r
560         </ul>\r
561     </div>\r
562                 </div>\r
563                         </div>\r
564         </td>\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
566     </tr>\r
567         <tr class="method-row inherited expandable">\r
568         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
569         <td class="sig">\r
570         <a id="Ext.data.Connection-un"></a>\r
571             <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
572                         <div class="short">Removes a listener (shorthand for removeListener)</div>\r
573             <div class="long">\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
578         <ul>\r
579             <li><code>void</code></li>\r
580         </ul>\r
581     </div>\r
582                 </div>\r
583                         </div>\r
584         </td>\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
586     </tr>\r
587             </table>
588                 <a id="Ext.data.Connection-events"></a>
589         <h2>Public Events</h2>
590                 <table cellspacing="0" class="member-table">
591             <tr>
592                 <th class="sig-header" colspan="2">Event</th>
593                 <th class="msource-header">Defined By</th>
594             </tr>
595                 <tr class="event-row expandable">\r
596         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
597         <td class="sig">\r
598         <a id="Ext.data.Connection-beforerequest"></a>\r
599             <b>beforerequest</b> : (&nbsp;<code>Connection conn</code>, <code>Object options</code>&nbsp;)            <div class="mdesc">\r
600                         <div class="short">Fires before a network request is made to retrieve a data object.</div>\r
601             <div class="long">\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
605     </div>\r
606                 </div>\r
607                         </div>\r
608         </td>\r
609         <td class="msource">Connection</td>\r
610     </tr>\r
611         <tr class="event-row alt expandable">\r
612         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
613         <td class="sig">\r
614         <a id="Ext.data.Connection-requestcomplete"></a>\r
615             <b>requestcomplete</b> : (&nbsp;<code>Connection conn</code>, <code>Object response</code>, <code>Object options</code>&nbsp;)            <div class="mdesc">\r
616                         <div class="short">Fires if the request was successfully completed.</div>\r
617             <div class="long">\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
623     </div>\r
624                 </div>\r
625                         </div>\r
626         </td>\r
627         <td class="msource">Connection</td>\r
628     </tr>\r
629         <tr class="event-row expandable">\r
630         <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>\r
631         <td class="sig">\r
632         <a id="Ext.data.Connection-requestexception"></a>\r
633             <b>requestexception</b> : (&nbsp;<code>Connection conn</code>, <code>Object response</code>, <code>Object options</code>&nbsp;)            <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
637             <div class="long">\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
645     </div>\r
646                 </div>\r
647                         </div>\r
648         </td>\r
649         <td class="msource">Connection</td>\r
650     </tr>\r
651             </table>
652         
653         </div>