1 <div class="body-wrap">
2 <div class="top-tools">
3 <a class="inner-link" href="#Ext.data.DataProxy-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4 <a class="inner-link" href="#Ext.data.DataProxy-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5 <a class="inner-link" href="#Ext.data.DataProxy-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6 <a class="inner-link" href="#Ext.data.DataProxy-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.DataProxy"><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"/>DataProxy</pre></div>
12 <h1>Class Ext.data.DataProxy</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/DataProxy.js" target="_blank">DataProxy.js</a></td></tr>
16 <tr><td class="label">Class:</td><td class="hd-info">DataProxy</td></tr>
17 <tr><td class="label">Subclasses:</td><td class="hd-info"><a ext:cls="Ext.data.HttpProxy" href="output/Ext.data.HttpProxy.html">HttpProxy</a>, <a ext:cls="Ext.data.MemoryProxy" href="output/Ext.data.MemoryProxy.html">MemoryProxy</a>, <a ext:cls="Ext.data.ScriptTagProxy" href="output/Ext.data.ScriptTagProxy.html">ScriptTagProxy</a>, <a ext:cls="Ext.sql.Proxy" href="output/Ext.sql.Proxy.html">Proxy</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 This class is an abstract base class for implementations which provide retrieval of
23 unformatted data objects.<br>
25 DataProxy implementations are usually used in conjunction with an implementation of Ext.data.DataReader
26 (of the appropriate type which knows how to parse the data object) to provide a block of
27 <a ext:cls="Ext.data.Records" href="output/Ext.data.Records.html">Ext.data.Records</a> to an <a ext:cls="Ext.data.Store" href="output/Ext.data.Store.html">Ext.data.Store</a>.<br>
29 Custom implementations must implement the load method as described in
30 <a ext:cls="Ext.data.HttpProxy" ext:member="load" href="output/Ext.data.HttpProxy.html#load">Ext.data.HttpProxy.load</a>. </div>
32 <div class="hr"></div>
33 <a id="Ext.data.DataProxy-configs"></a>
34 <h2>Config Options</h2>
35 <table cellspacing="0" class="member-table">
37 <th class="sig-header" colspan="2">Config Options</th>
38 <th class="msource-header">Defined By</th>
40 <tr class="config-row inherited expandable">
\r
41 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
43 <a id="Ext.data.DataProxy-listeners"></a>
\r
44 <b>listeners</b> : Object <div class="mdesc">
\r
45 <div class="short">(optional) A config object containing one or more event handlers to be added to this object during initialization. Th...</div>
\r
47 (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
50 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#listeners" href="output/Ext.util.Observable.html#listeners">Observable</a></td>
\r
53 <a id="Ext.data.DataProxy-props"></a>
54 <h2>Public Properties</h2>
55 <div class="no-members">This class has no public properties.</div> <a id="Ext.data.DataProxy-methods"></a>
56 <h2>Public Methods</h2>
57 <table cellspacing="0" class="member-table">
59 <th class="sig-header" colspan="2">Method</th>
60 <th class="msource-header">Defined By</th>
62 <tr class="method-row inherited expandable">
\r
63 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
65 <a id="Ext.data.DataProxy-addEvents"></a>
\r
66 <b>addEvents</b>( <code>Object object</code> ) : void <div class="mdesc">
\r
67 <div class="short">Used to define events on this Observable</div>
\r
69 Used to define events on this Observable <div class="mdetail-params">
\r
70 <strong>Parameters:</strong>
\r
71 <ul><li><code>object</code> : Object<div class="sub-desc">The object with the events defined</div></li> </ul>
\r
72 <strong>Returns:</strong>
\r
74 <li><code>void</code></li>
\r
80 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addEvents" href="output/Ext.util.Observable.html#addEvents">Observable</a></td>
\r
82 <tr class="method-row inherited alt expandable">
\r
83 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
85 <a id="Ext.data.DataProxy-addListener"></a>
\r
86 <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
87 <div class="short">Appends an event handler to this component</div>
\r
89 Appends an event handler to this component <div class="mdetail-params">
\r
90 <strong>Parameters:</strong>
\r
91 <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
92 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration
93 properties. This may contain any of the following properties:<ul>
94 <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>
95 <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>
96 <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>
97 <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
98 by the specified number of milliseconds. If the event fires again within that time, the original
99 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</p></li>
102 <b>Combining Options</b><br>
103 Using the options argument, it is possible to combine different types of listeners:<br>
105 A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
106 <pre><code>el.on(<em>'click'</em>, <b>this</b>.onClick, <b>this</b>, {
112 <b>Attaching multiple handlers in 1 call</b><br>
113 The method also allows for a single argument to be passed which is a config object containing properties
114 which specify multiple handlers.
118 fn: <b>this</b>.onClick,
122 <em>'mouseover'</em> : {
123 fn: <b>this</b>.onMouseOver,
126 <em>'mouseout'</em> : {
127 fn: <b>this</b>.onMouseOut,
132 Or a shorthand syntax:<br>
134 <em>'click'</em> : <b>this</b>.onClick,
135 <em>'mouseover'</em> : <b>this</b>.onMouseOver,
136 <em>'mouseout'</em> : <b>this</b>.onMouseOut,
138 });</code></pre></div></li> </ul>
\r
139 <strong>Returns:</strong>
\r
141 <li><code>void</code></li>
\r
147 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addListener" href="output/Ext.util.Observable.html#addListener">Observable</a></td>
\r
149 <tr class="method-row inherited expandable">
\r
150 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
152 <a id="Ext.data.DataProxy-fireEvent"></a>
\r
153 <b>fireEvent</b>( <code>String eventName</code>, <code>Object... args</code> ) : Boolean <div class="mdesc">
\r
154 <div class="short">Fires the specified event with the passed parameters (minus the event name).</div>
\r
156 Fires the specified event with the passed parameters (minus the event name). <div class="mdetail-params">
\r
157 <strong>Parameters:</strong>
\r
158 <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
159 <strong>Returns:</strong>
\r
161 <li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>
\r
167 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#fireEvent" href="output/Ext.util.Observable.html#fireEvent">Observable</a></td>
\r
169 <tr class="method-row inherited alt expandable">
\r
170 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
172 <a id="Ext.data.DataProxy-hasListener"></a>
\r
173 <b>hasListener</b>( <code>String eventName</code> ) : Boolean <div class="mdesc">
\r
174 <div class="short">Checks to see if this object has any listeners for a specified event</div>
\r
176 Checks to see if this object has any listeners for a specified event <div class="mdetail-params">
\r
177 <strong>Parameters:</strong>
\r
178 <ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li> </ul>
\r
179 <strong>Returns:</strong>
\r
181 <li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li>
\r
187 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#hasListener" href="output/Ext.util.Observable.html#hasListener">Observable</a></td>
\r
189 <tr class="method-row inherited expandable">
\r
190 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
192 <a id="Ext.data.DataProxy-on"></a>
\r
193 <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
194 <div class="short">Appends an event handler to this element (shorthand for addListener)</div>
\r
196 Appends an event handler to this element (shorthand for addListener) <div class="mdetail-params">
\r
197 <strong>Parameters:</strong>
\r
198 <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
199 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional)</div></li> </ul>
\r
200 <strong>Returns:</strong>
\r
202 <li><code>void</code></li>
\r
208 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#on" href="output/Ext.util.Observable.html#on">Observable</a></td>
\r
210 <tr class="method-row inherited alt expandable">
\r
211 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
213 <a id="Ext.data.DataProxy-purgeListeners"></a>
\r
214 <b>purgeListeners</b>() : void <div class="mdesc">
\r
215 <div class="short">Removes all listeners for this object</div>
\r
217 Removes all listeners for this object <div class="mdetail-params">
\r
218 <strong>Parameters:</strong>
\r
219 <ul><li>None.</li> </ul>
\r
220 <strong>Returns:</strong>
\r
222 <li><code>void</code></li>
\r
228 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#purgeListeners" href="output/Ext.util.Observable.html#purgeListeners">Observable</a></td>
\r
230 <tr class="method-row inherited expandable">
\r
231 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
233 <a id="Ext.data.DataProxy-relayEvents"></a>
\r
234 <b>relayEvents</b>( <code>Object o</code>, <code>Array events</code> ) : void <div class="mdesc">
\r
235 <div class="short">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.</div>
\r
237 Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>. <div class="mdetail-params">
\r
238 <strong>Parameters:</strong>
\r
239 <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
240 <strong>Returns:</strong>
\r
242 <li><code>void</code></li>
\r
248 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#relayEvents" href="output/Ext.util.Observable.html#relayEvents">Observable</a></td>
\r
250 <tr class="method-row inherited alt expandable">
\r
251 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
253 <a id="Ext.data.DataProxy-removeListener"></a>
\r
254 <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
255 <div class="short">Removes a listener</div>
\r
257 Removes a listener <div class="mdetail-params">
\r
258 <strong>Parameters:</strong>
\r
259 <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
260 <strong>Returns:</strong>
\r
262 <li><code>void</code></li>
\r
268 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#removeListener" href="output/Ext.util.Observable.html#removeListener">Observable</a></td>
\r
270 <tr class="method-row inherited expandable">
\r
271 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
273 <a id="Ext.data.DataProxy-resumeEvents"></a>
\r
274 <b>resumeEvents</b>() : void <div class="mdesc">
\r
275 <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
277 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
278 <strong>Parameters:</strong>
\r
279 <ul><li>None.</li> </ul>
\r
280 <strong>Returns:</strong>
\r
282 <li><code>void</code></li>
\r
288 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">Observable</a></td>
\r
290 <tr class="method-row inherited alt expandable">
\r
291 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
293 <a id="Ext.data.DataProxy-suspendEvents"></a>
\r
294 <b>suspendEvents</b>() : void <div class="mdesc">
\r
295 <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
297 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
298 <strong>Parameters:</strong>
\r
299 <ul><li>None.</li> </ul>
\r
300 <strong>Returns:</strong>
\r
302 <li><code>void</code></li>
\r
308 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">Observable</a></td>
\r
310 <tr class="method-row inherited expandable">
\r
311 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
313 <a id="Ext.data.DataProxy-un"></a>
\r
314 <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
315 <div class="short">Removes a listener (shorthand for removeListener)</div>
\r
317 Removes a listener (shorthand for removeListener) <div class="mdetail-params">
\r
318 <strong>Parameters:</strong>
\r
319 <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
320 <strong>Returns:</strong>
\r
322 <li><code>void</code></li>
\r
328 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#un" href="output/Ext.util.Observable.html#un">Observable</a></td>
\r
331 <a id="Ext.data.DataProxy-events"></a>
332 <h2>Public Events</h2>
333 <table cellspacing="0" class="member-table">
335 <th class="sig-header" colspan="2">Event</th>
336 <th class="msource-header">Defined By</th>
338 <tr class="event-row expandable">
\r
339 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
341 <a id="Ext.data.DataProxy-beforeload"></a>
\r
342 <b>beforeload</b> : ( <code>Object this</code>, <code>Object params</code> ) <div class="mdesc">
\r
343 <div class="short">Fires before a network request is made to retrieve a data object.</div>
\r
345 Fires before a network request is made to retrieve a data object. <div class="mdetail-params">
\r
346 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
347 <ul><li><code>this</code> : Object<div class="sub-desc"></div></li><li><code>params</code> : Object<div class="sub-desc">The params object passed to the <a ext:cls="Ext.data.DataProxy" ext:member="load" href="output/Ext.data.DataProxy.html#load">load</a> function</div></li> </ul>
\r
352 <td class="msource">DataProxy</td>
\r
354 <tr class="event-row alt expandable">
\r
355 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
357 <a id="Ext.data.DataProxy-load"></a>
\r
358 <b>load</b> : ( <code>Object this</code>, <code>Object o</code>, <code>Object arg</code> ) <div class="mdesc">
\r
359 <div class="short">Fires before the load method's callback is called.</div>
\r
361 Fires before the load method's callback is called. <div class="mdetail-params">
\r
362 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
363 <ul><li><code>this</code> : Object<div class="sub-desc"></div></li><li><code>o</code> : Object<div class="sub-desc">The data object</div></li><li><code>arg</code> : Object<div class="sub-desc">The callback's arg object passed to the <a ext:cls="Ext.data.DataProxy" ext:member="load" href="output/Ext.data.DataProxy.html#load">load</a> function</div></li> </ul>
\r
368 <td class="msource">DataProxy</td>
\r