1 <div class="body-wrap">
2 <div class="top-tools">
3 <a class="inner-link" href="#Ext.data.MemoryProxy-props"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a>
4 <a class="inner-link" href="#Ext.data.MemoryProxy-methods"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a>
5 <a class="inner-link" href="#Ext.data.MemoryProxy-events"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a>
6 <a class="inner-link" href="#Ext.data.MemoryProxy-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.MemoryProxy"><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"/><a ext:cls="Ext.data.DataProxy" ext:member="" href="output/Ext.data.DataProxy.html">DataProxy</a>
12 <img src="resources/elbow-end.gif"/>MemoryProxy</pre></div>
13 <h1>Class Ext.data.MemoryProxy</h1>
14 <table cellspacing="0">
15 <tr><td class="label">Package:</td><td class="hd-info">Ext.data</td></tr>
16 <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../src/MemoryProxy.js" target="_blank">MemoryProxy.js</a></td></tr>
17 <tr><td class="label">Class:</td><td class="hd-info">MemoryProxy</td></tr>
18 <tr><td class="label">Extends:</td><td class="hd-info"><a ext:cls="Ext.data.DataProxy" ext:member="" href="output/Ext.data.DataProxy.html">DataProxy</a></td></tr>
20 <div class="description">
22 An implementation of Ext.data.DataProxy that simply passes the data specified in its constructor
23 to the Reader when its load method is called. </div>
25 <div class="hr"></div>
26 <a id="Ext.data.MemoryProxy-configs"></a>
27 <h2>Config Options</h2>
28 <table cellspacing="0" class="member-table">
30 <th class="sig-header" colspan="2">Config Options</th>
31 <th class="msource-header">Defined By</th>
33 <tr class="config-row inherited expandable">
\r
34 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
36 <a id="Ext.data.MemoryProxy-listeners"></a>
\r
37 <b>listeners</b> : Object <div class="mdesc">
\r
38 <div class="short">(optional) A config object containing one or more event handlers to be added to this object during initialization. Th...</div>
\r
40 (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
43 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#listeners" href="output/Ext.util.Observable.html#listeners">Observable</a></td>
\r
46 <a id="Ext.data.MemoryProxy-props"></a>
47 <h2>Public Properties</h2>
48 <div class="no-members">This class has no public properties.</div> <a id="Ext.data.MemoryProxy-methods"></a>
49 <h2>Public Methods</h2>
50 <table cellspacing="0" class="member-table">
52 <th class="sig-header" colspan="2">Method</th>
53 <th class="msource-header">Defined By</th>
55 <tr class="method-row expandable">
\r
56 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
58 <a id="Ext.data.MemoryProxy-MemoryProxy"></a>
\r
59 <b>MemoryProxy</b>( <code>Object data</code> ) <div class="mdesc">
\r
60 <div class="short"></div>
\r
62 <div class="mdetail-params">
\r
63 <strong>Parameters:</strong>
\r
64 <ul><li><code>data</code> : Object<div class="sub-desc">The data object which the Reader uses to construct a block of Ext.data.Records.</div></li> </ul>
\r
65 <strong>Returns:</strong>
\r
67 <li><code></code></li>
\r
73 <td class="msource">MemoryProxy</td>
\r
75 <tr class="method-row inherited alt expandable">
\r
76 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
78 <a id="Ext.data.MemoryProxy-addEvents"></a>
\r
79 <b>addEvents</b>( <code>Object object</code> ) : void <div class="mdesc">
\r
80 <div class="short">Used to define events on this Observable</div>
\r
82 Used to define events on this Observable <div class="mdetail-params">
\r
83 <strong>Parameters:</strong>
\r
84 <ul><li><code>object</code> : Object<div class="sub-desc">The object with the events defined</div></li> </ul>
\r
85 <strong>Returns:</strong>
\r
87 <li><code>void</code></li>
\r
93 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addEvents" href="output/Ext.util.Observable.html#addEvents">Observable</a></td>
\r
95 <tr class="method-row inherited expandable">
\r
96 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
98 <a id="Ext.data.MemoryProxy-addListener"></a>
\r
99 <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
100 <div class="short">Appends an event handler to this component</div>
\r
102 Appends an event handler to this component <div class="mdetail-params">
\r
103 <strong>Parameters:</strong>
\r
104 <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
105 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration
106 properties. This may contain any of the following properties:<ul>
107 <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>
108 <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>
109 <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>
110 <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
111 by the specified number of milliseconds. If the event fires again within that time, the original
112 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</p></li>
115 <b>Combining Options</b><br>
116 Using the options argument, it is possible to combine different types of listeners:<br>
118 A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
119 <pre><code>el.on(<em>'click'</em>, <b>this</b>.onClick, <b>this</b>, {
125 <b>Attaching multiple handlers in 1 call</b><br>
126 The method also allows for a single argument to be passed which is a config object containing properties
127 which specify multiple handlers.
131 fn: <b>this</b>.onClick,
135 <em>'mouseover'</em> : {
136 fn: <b>this</b>.onMouseOver,
139 <em>'mouseout'</em> : {
140 fn: <b>this</b>.onMouseOut,
145 Or a shorthand syntax:<br>
147 <em>'click'</em> : <b>this</b>.onClick,
148 <em>'mouseover'</em> : <b>this</b>.onMouseOver,
149 <em>'mouseout'</em> : <b>this</b>.onMouseOut,
151 });</code></pre></div></li> </ul>
\r
152 <strong>Returns:</strong>
\r
154 <li><code>void</code></li>
\r
160 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#addListener" href="output/Ext.util.Observable.html#addListener">Observable</a></td>
\r
162 <tr class="method-row inherited alt expandable">
\r
163 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
165 <a id="Ext.data.MemoryProxy-fireEvent"></a>
\r
166 <b>fireEvent</b>( <code>String eventName</code>, <code>Object... args</code> ) : Boolean <div class="mdesc">
\r
167 <div class="short">Fires the specified event with the passed parameters (minus the event name).</div>
\r
169 Fires the specified event with the passed parameters (minus the event name). <div class="mdetail-params">
\r
170 <strong>Parameters:</strong>
\r
171 <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
172 <strong>Returns:</strong>
\r
174 <li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>
\r
180 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#fireEvent" href="output/Ext.util.Observable.html#fireEvent">Observable</a></td>
\r
182 <tr class="method-row inherited expandable">
\r
183 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
185 <a id="Ext.data.MemoryProxy-hasListener"></a>
\r
186 <b>hasListener</b>( <code>String eventName</code> ) : Boolean <div class="mdesc">
\r
187 <div class="short">Checks to see if this object has any listeners for a specified event</div>
\r
189 Checks to see if this object has any listeners for a specified event <div class="mdetail-params">
\r
190 <strong>Parameters:</strong>
\r
191 <ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li> </ul>
\r
192 <strong>Returns:</strong>
\r
194 <li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li>
\r
200 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#hasListener" href="output/Ext.util.Observable.html#hasListener">Observable</a></td>
\r
202 <tr class="method-row alt expandable">
\r
203 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
205 <a id="Ext.data.MemoryProxy-load"></a>
\r
206 <b>load</b>( <code>Object params</code>, <code>Ext.data.DataReader reader</code>, <code>Function callback</code>, <code>Object scope</code>, <code>Object arg</code> ) : void <div class="mdesc">
\r
208 Load data from the requested source (in this case an in-memory
209 data object passed to the constructor), read the data...</div>
\r
212 Load data from the requested source (in this case an in-memory
213 data object passed to the constructor), read the data object into
214 a block of Ext.data.Records using the passed Ext.data.DataReader implementation, and
215 process that block using the passed callback. <div class="mdetail-params">
\r
216 <strong>Parameters:</strong>
\r
217 <ul><li><code>params</code> : Object<div class="sub-desc">This parameter is not used by the MemoryProxy class.</div></li><li><code>reader</code> : Ext.data.DataReader<div class="sub-desc">The Reader object which converts the data
218 object into a block of Ext.data.Records.</div></li><li><code>callback</code> : Function<div class="sub-desc">The function into which to pass the block of Ext.data.records.
219 The function must be passed <ul>
220 <li>The Record block object</li>
221 <li>The "arg" argument from the load function</li>
222 <li>A boolean success indicator</li>
223 </ul></div></li><li><code>scope</code> : Object<div class="sub-desc">The scope in which to call the callback</div></li><li><code>arg</code> : Object<div class="sub-desc">An optional argument which is passed to the callback as its second parameter.</div></li> </ul>
\r
224 <strong>Returns:</strong>
\r
226 <li><code>void</code></li>
\r
232 <td class="msource">MemoryProxy</td>
\r
234 <tr class="method-row inherited expandable">
\r
235 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
237 <a id="Ext.data.MemoryProxy-on"></a>
\r
238 <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
239 <div class="short">Appends an event handler to this element (shorthand for addListener)</div>
\r
241 Appends an event handler to this element (shorthand for addListener) <div class="mdetail-params">
\r
242 <strong>Parameters:</strong>
\r
243 <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
244 function. The handler function's "this" context.</div></li><li><code>options</code> : Object<div class="sub-desc">(optional)</div></li> </ul>
\r
245 <strong>Returns:</strong>
\r
247 <li><code>void</code></li>
\r
253 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#on" href="output/Ext.util.Observable.html#on">Observable</a></td>
\r
255 <tr class="method-row inherited alt expandable">
\r
256 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
258 <a id="Ext.data.MemoryProxy-purgeListeners"></a>
\r
259 <b>purgeListeners</b>() : void <div class="mdesc">
\r
260 <div class="short">Removes all listeners for this object</div>
\r
262 Removes all listeners for this object <div class="mdetail-params">
\r
263 <strong>Parameters:</strong>
\r
264 <ul><li>None.</li> </ul>
\r
265 <strong>Returns:</strong>
\r
267 <li><code>void</code></li>
\r
273 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#purgeListeners" href="output/Ext.util.Observable.html#purgeListeners">Observable</a></td>
\r
275 <tr class="method-row inherited expandable">
\r
276 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
278 <a id="Ext.data.MemoryProxy-relayEvents"></a>
\r
279 <b>relayEvents</b>( <code>Object o</code>, <code>Array events</code> ) : void <div class="mdesc">
\r
280 <div class="short">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.</div>
\r
282 Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>. <div class="mdetail-params">
\r
283 <strong>Parameters:</strong>
\r
284 <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
285 <strong>Returns:</strong>
\r
287 <li><code>void</code></li>
\r
293 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#relayEvents" href="output/Ext.util.Observable.html#relayEvents">Observable</a></td>
\r
295 <tr class="method-row inherited alt expandable">
\r
296 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
298 <a id="Ext.data.MemoryProxy-removeListener"></a>
\r
299 <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
300 <div class="short">Removes a listener</div>
\r
302 Removes a listener <div class="mdetail-params">
\r
303 <strong>Parameters:</strong>
\r
304 <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
305 <strong>Returns:</strong>
\r
307 <li><code>void</code></li>
\r
313 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#removeListener" href="output/Ext.util.Observable.html#removeListener">Observable</a></td>
\r
315 <tr class="method-row inherited expandable">
\r
316 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
318 <a id="Ext.data.MemoryProxy-resumeEvents"></a>
\r
319 <b>resumeEvents</b>() : void <div class="mdesc">
\r
320 <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
322 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
323 <strong>Parameters:</strong>
\r
324 <ul><li>None.</li> </ul>
\r
325 <strong>Returns:</strong>
\r
327 <li><code>void</code></li>
\r
333 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#resumeEvents" href="output/Ext.util.Observable.html#resumeEvents">Observable</a></td>
\r
335 <tr class="method-row inherited alt expandable">
\r
336 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
338 <a id="Ext.data.MemoryProxy-suspendEvents"></a>
\r
339 <b>suspendEvents</b>() : void <div class="mdesc">
\r
340 <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
342 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
343 <strong>Parameters:</strong>
\r
344 <ul><li>None.</li> </ul>
\r
345 <strong>Returns:</strong>
\r
347 <li><code>void</code></li>
\r
353 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#suspendEvents" href="output/Ext.util.Observable.html#suspendEvents">Observable</a></td>
\r
355 <tr class="method-row inherited expandable">
\r
356 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
358 <a id="Ext.data.MemoryProxy-un"></a>
\r
359 <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
360 <div class="short">Removes a listener (shorthand for removeListener)</div>
\r
362 Removes a listener (shorthand for removeListener) <div class="mdetail-params">
\r
363 <strong>Parameters:</strong>
\r
364 <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
365 <strong>Returns:</strong>
\r
367 <li><code>void</code></li>
\r
373 <td class="msource"><a ext:cls="Ext.util.Observable" ext:member="#un" href="output/Ext.util.Observable.html#un">Observable</a></td>
\r
376 <a id="Ext.data.MemoryProxy-events"></a>
377 <h2>Public Events</h2>
378 <table cellspacing="0" class="member-table">
380 <th class="sig-header" colspan="2">Event</th>
381 <th class="msource-header">Defined By</th>
383 <tr class="event-row inherited expandable">
\r
384 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
386 <a id="Ext.data.MemoryProxy-beforeload"></a>
\r
387 <b>beforeload</b> : ( <code>Object this</code>, <code>Object params</code> ) <div class="mdesc">
\r
388 <div class="short">Fires before a network request is made to retrieve a data object.</div>
\r
390 Fires before a network request is made to retrieve a data object. <div class="mdetail-params">
\r
391 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
392 <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
397 <td class="msource"><a ext:cls="Ext.data.DataProxy" ext:member="#event-beforeload" href="output/Ext.data.DataProxy.html#event-beforeload">DataProxy</a></td>
\r
399 <tr class="event-row inherited alt expandable">
\r
400 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
402 <a id="Ext.data.MemoryProxy-load"></a>
\r
403 <b>load</b> : ( <code>Object this</code>, <code>Object o</code>, <code>Object arg</code> ) <div class="mdesc">
\r
404 <div class="short">Fires before the load method's callback is called.</div>
\r
406 Fires before the load method's callback is called. <div class="mdetail-params">
\r
407 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
408 <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
413 <td class="msource"><a ext:cls="Ext.data.DataProxy" ext:member="#event-load" href="output/Ext.data.DataProxy.html#event-load">DataProxy</a></td>
\r
415 <tr class="event-row expandable">
\r
416 <td class="micon"><a class="exi" href="#expand"> </a></td>
\r
418 <a id="Ext.data.MemoryProxy-loadexception"></a>
\r
419 <b>loadexception</b> : ( <code>Object this</code>, <code>Object arg</code>, <code>Object null</code>, <code>Error e</code> ) <div class="mdesc">
\r
420 <div class="short">Fires if an exception occurs in the Proxy during data loading. Note that this event is also relayed
421 through Ext.data...</div>
\r
423 Fires if an exception occurs in the Proxy during data loading. Note that this event is also relayed
424 through <a ext:cls="Ext.data.Store" href="output/Ext.data.Store.html">Ext.data.Store</a>, so you can listen for it directly on any Store instance. <div class="mdetail-params">
\r
425 <strong style="font-weight:normal;">Listeners will be called with the following arguments:</strong>
\r
426 <ul><li><code>this</code> : Object<div class="sub-desc"></div></li><li><code>arg</code> : Object<div class="sub-desc">The callback's arg object passed to the <a ext:cls="Ext.data.MemoryProxy" ext:member="load" href="output/Ext.data.MemoryProxy.html#load">load</a> function</div></li><li><code>null</code> : Object<div class="sub-desc">This parameter does not apply and will always be null for MemoryProxy</div></li><li><code>e</code> : Error<div class="sub-desc">The JavaScript Error object caught if the configured Reader could not read the data</div></li> </ul>
\r
431 <td class="msource">MemoryProxy</td>
\r