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