Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / docs / source / AbstractStore.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5   <title>The source code</title>
6   <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7   <script type="text/javascript" src="../prettify/prettify.js"></script>
8   <style type="text/css">
9     .highlight { display: block; background-color: #ddd; }
10   </style>
11   <script type="text/javascript">
12     function highlight() {
13       document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
14     }
15   </script>
16 </head>
17 <body onload="prettyPrint(); highlight();">
18   <pre class="prettyprint lang-js"><span id='Ext-data-AbstractStore'>/**
19 </span> * @author Ed Spencer
20  * @class Ext.data.AbstractStore
21  *
22  * &lt;p&gt;AbstractStore is a superclass of {@link Ext.data.Store} and {@link Ext.data.TreeStore}. It's never used directly,
23  * but offers a set of methods used by both of those subclasses.&lt;/p&gt;
24  * 
25  * &lt;p&gt;We've left it here in the docs for reference purposes, but unless you need to make a whole new type of Store, what
26  * you're probably looking for is {@link Ext.data.Store}. If you're still interested, here's a brief description of what 
27  * AbstractStore is and is not.&lt;/p&gt;
28  * 
29  * &lt;p&gt;AbstractStore provides the basic configuration for anything that can be considered a Store. It expects to be 
30  * given a {@link Ext.data.Model Model} that represents the type of data in the Store. It also expects to be given a 
31  * {@link Ext.data.proxy.Proxy Proxy} that handles the loading of data into the Store.&lt;/p&gt;
32  * 
33  * &lt;p&gt;AbstractStore provides a few helpful methods such as {@link #load} and {@link #sync}, which load and save data
34  * respectively, passing the requests through the configured {@link #proxy}. Both built-in Store subclasses add extra
35  * behavior to each of these functions. Note also that each AbstractStore subclass has its own way of storing data - 
36  * in {@link Ext.data.Store} the data is saved as a flat {@link Ext.util.MixedCollection MixedCollection}, whereas in
37  * {@link Ext.data.TreeStore TreeStore} we use a {@link Ext.data.Tree} to maintain the data's hierarchy.&lt;/p&gt;
38  * 
39  * The store provides filtering and sorting support. This sorting/filtering can happen on the client side
40  * or can be completed on the server. This is controlled by the {@link #remoteSort} and (@link #remoteFilter{ config
41  * options. For more information see the {@link #sort} and {@link #filter} methods.
42  */
43 Ext.define('Ext.data.AbstractStore', {
44     requires: ['Ext.util.MixedCollection', 'Ext.data.Operation', 'Ext.util.Filter'],
45     
46     mixins: {
47         observable: 'Ext.util.Observable',
48         sortable: 'Ext.util.Sortable'
49     },
50     
51     statics: {
52         create: function(store){
53             if (!store.isStore) {
54                 if (!store.type) {
55                     store.type = 'store';
56                 }
57                 store = Ext.createByAlias('store.' + store.type, store);
58             }
59             return store;
60         }    
61     },
62     
63     remoteSort  : false,
64     remoteFilter: false,
65
66 <span id='Ext-data-AbstractStore-cfg-proxy'>    /**
67 </span>     * @cfg {String/Ext.data.proxy.Proxy/Object} proxy The Proxy to use for this Store. This can be either a string, a config
68      * object or a Proxy instance - see {@link #setProxy} for details.
69      */
70
71 <span id='Ext-data-AbstractStore-cfg-autoLoad'>    /**
72 </span>     * @cfg {Boolean/Object} autoLoad If data is not specified, and if autoLoad is true or an Object, this store's load method
73      * is automatically called after creation. If the value of autoLoad is an Object, this Object will be passed to the store's
74      * load method. Defaults to false.
75      */
76     autoLoad: false,
77
78 <span id='Ext-data-AbstractStore-cfg-autoSync'>    /**
79 </span>     * @cfg {Boolean} autoSync True to automatically sync the Store with its Proxy after every edit to one of its Records.
80      * Defaults to false.
81      */
82     autoSync: false,
83
84 <span id='Ext-data-AbstractStore-property-batchUpdateMode'>    /**
85 </span>     * Sets the updating behavior based on batch synchronization. 'operation' (the default) will update the Store's
86      * internal representation of the data after each operation of the batch has completed, 'complete' will wait until
87      * the entire batch has been completed before updating the Store's data. 'complete' is a good choice for local
88      * storage proxies, 'operation' is better for remote proxies, where there is a comparatively high latency.
89      * @property batchUpdateMode
90      * @type String
91      */
92     batchUpdateMode: 'operation',
93
94 <span id='Ext-data-AbstractStore-property-filterOnLoad'>    /**
95 </span>     * If true, any filters attached to this Store will be run after loading data, before the datachanged event is fired.
96      * Defaults to true, ignored if {@link #remoteFilter} is true
97      * @property filterOnLoad
98      * @type Boolean
99      */
100     filterOnLoad: true,
101
102 <span id='Ext-data-AbstractStore-property-sortOnLoad'>    /**
103 </span>     * If true, any sorters attached to this Store will be run after loading data, before the datachanged event is fired.
104      * Defaults to true, igored if {@link #remoteSort} is true
105      * @property sortOnLoad
106      * @type Boolean
107      */
108     sortOnLoad: true,
109
110 <span id='Ext-data-AbstractStore-property-implicitModel'>    /**
111 </span>     * True if a model was created implicitly for this Store. This happens if a fields array is passed to the Store's constructor
112      * instead of a model constructor or name.
113      * @property implicitModel
114      * @type Boolean
115      * @private
116      */
117     implicitModel: false,
118
119 <span id='Ext-data-AbstractStore-property-defaultProxyType'>    /**
120 </span>     * The string type of the Proxy to create if none is specified. This defaults to creating a {@link Ext.data.proxy.Memory memory proxy}.
121      * @property defaultProxyType
122      * @type String
123      */
124     defaultProxyType: 'memory',
125
126 <span id='Ext-data-AbstractStore-property-isDestroyed'>    /**
127 </span>     * True if the Store has already been destroyed via {@link #destroyStore}. If this is true, the reference to Store should be deleted
128      * as it will not function correctly any more.
129      * @property isDestroyed
130      * @type Boolean
131      */
132     isDestroyed: false,
133
134     isStore: true,
135
136 <span id='Ext-data-AbstractStore-cfg-storeId'>    /**
137 </span>     * @cfg {String} storeId Optional unique identifier for this store. If present, this Store will be registered with 
138      * the {@link Ext.data.StoreManager}, making it easy to reuse elsewhere. Defaults to undefined.
139      */
140     
141 <span id='Ext-data-AbstractStore-cfg-fields'>    /**
142 </span>     * @cfg {Array} fields
143      * This may be used in place of specifying a {@link #model} configuration. The fields should be a 
144      * set of {@link Ext.data.Field} configuration objects. The store will automatically create a {@link Ext.data.Model}
145      * with these fields. In general this configuration option should be avoided, it exists for the purposes of
146      * backwards compatibility. For anything more complicated, such as specifying a particular id property or
147      * assocations, a {@link Ext.data.Model} should be defined and specified for the {@link #model} config.
148      */
149
150     sortRoot: 'data',
151     
152     //documented above
153     constructor: function(config) {
154         var me = this,
155             filters;
156         
157         me.addEvents(
158 <span id='Ext-data-AbstractStore-event-add'>            /**
159 </span>             * @event add
160              * Fired when a Model instance has been added to this Store
161              * @param {Ext.data.Store} store The store
162              * @param {Array} records The Model instances that were added
163              * @param {Number} index The index at which the instances were inserted
164              */
165             'add',
166
167 <span id='Ext-data-AbstractStore-event-remove'>            /**
168 </span>             * @event remove
169              * Fired when a Model instance has been removed from this Store
170              * @param {Ext.data.Store} store The Store object
171              * @param {Ext.data.Model} record The record that was removed
172              * @param {Number} index The index of the record that was removed
173              */
174             'remove',
175             
176 <span id='Ext-data-AbstractStore-event-update'>            /**
177 </span>             * @event update
178              * Fires when a Record has been updated
179              * @param {Store} this
180              * @param {Ext.data.Model} record The Model instance that was updated
181              * @param {String} operation The update operation being performed. Value may be one of:
182              * &lt;pre&gt;&lt;code&gt;
183                Ext.data.Model.EDIT
184                Ext.data.Model.REJECT
185                Ext.data.Model.COMMIT
186              * &lt;/code&gt;&lt;/pre&gt;
187              */
188             'update',
189
190 <span id='Ext-data-AbstractStore-event-datachanged'>            /**
191 </span>             * @event datachanged
192              * Fires whenever the records in the Store have changed in some way - this could include adding or removing records,
193              * or updating the data in existing records
194              * @param {Ext.data.Store} this The data store
195              */
196             'datachanged',
197
198 <span id='Ext-data-AbstractStore-event-beforeload'>            /**
199 </span>             * @event beforeload
200              * Event description
201              * @param {Ext.data.Store} store This Store
202              * @param {Ext.data.Operation} operation The Ext.data.Operation object that will be passed to the Proxy to load the Store
203              */
204             'beforeload',
205
206 <span id='Ext-data-AbstractStore-event-load'>            /**
207 </span>             * @event load
208              * Fires whenever the store reads data from a remote data source.
209              * @param {Ext.data.Store} this
210              * @param {Array} records An array of records
211              * @param {Boolean} successful True if the operation was successful.
212              */
213             'load',
214
215 <span id='Ext-data-AbstractStore-event-beforesync'>            /**
216 </span>             * @event beforesync
217              * Called before a call to {@link #sync} is executed. Return false from any listener to cancel the synv
218              * @param {Object} options Hash of all records to be synchronized, broken down into create, update and destroy
219              */
220             'beforesync',
221 <span id='Ext-data-AbstractStore-event-clear'>            /**
222 </span>             * @event clear
223              * Fired after the {@link #removeAll} method is called.
224              * @param {Ext.data.Store} this
225              */
226             'clear'
227         );
228         
229         Ext.apply(me, config);
230         // don't use *config* anymore from here on... use *me* instead...
231
232 <span id='Ext-data-AbstractStore-property-removed'>        /**
233 </span>         * Temporary cache in which removed model instances are kept until successfully synchronised with a Proxy,
234          * at which point this is cleared.
235          * @private
236          * @property removed
237          * @type Array
238          */
239         me.removed = [];
240
241         me.mixins.observable.constructor.apply(me, arguments);
242         me.model = Ext.ModelManager.getModel(me.model);
243
244 <span id='Ext-data-AbstractStore-property-modelDefaults'>        /**
245 </span>         * @property modelDefaults
246          * @type Object
247          * @private
248          * A set of default values to be applied to every model instance added via {@link #insert} or created via {@link #create}.
249          * This is used internally by associations to set foreign keys and other fields. See the Association classes source code
250          * for examples. This should not need to be used by application developers.
251          */
252         Ext.applyIf(me, {
253             modelDefaults: {}
254         });
255
256         //Supports the 3.x style of simply passing an array of fields to the store, implicitly creating a model
257         if (!me.model &amp;&amp; me.fields) {
258             me.model = Ext.define('Ext.data.Store.ImplicitModel-' + (me.storeId || Ext.id()), {
259                 extend: 'Ext.data.Model',
260                 fields: me.fields,
261                 proxy: me.proxy || me.defaultProxyType
262             });
263
264             delete me.fields;
265
266             me.implicitModel = true;
267         }
268
269         //ensures that the Proxy is instantiated correctly
270         me.setProxy(me.proxy || me.model.getProxy());
271
272         if (me.id &amp;&amp; !me.storeId) {
273             me.storeId = me.id;
274             delete me.id;
275         }
276
277         if (me.storeId) {
278             Ext.data.StoreManager.register(me);
279         }
280         
281         me.mixins.sortable.initSortable.call(me);        
282         
283 <span id='Ext-data-AbstractStore-property-filters'>        /**
284 </span>         * The collection of {@link Ext.util.Filter Filters} currently applied to this Store
285          * @property filters
286          * @type Ext.util.MixedCollection
287          */
288         filters = me.decodeFilters(me.filters);
289         me.filters = Ext.create('Ext.util.MixedCollection');
290         me.filters.addAll(filters);
291     },
292
293 <span id='Ext-data-AbstractStore-method-setProxy'>    /**
294 </span>     * Sets the Store's Proxy by string, config object or Proxy instance
295      * @param {String|Object|Ext.data.proxy.Proxy} proxy The new Proxy, which can be either a type string, a configuration object
296      * or an Ext.data.proxy.Proxy instance
297      * @return {Ext.data.proxy.Proxy} The attached Proxy object
298      */
299     setProxy: function(proxy) {
300         var me = this;
301         
302         if (proxy instanceof Ext.data.proxy.Proxy) {
303             proxy.setModel(me.model);
304         } else {
305             if (Ext.isString(proxy)) {
306                 proxy = {
307                     type: proxy    
308                 };
309             }
310             Ext.applyIf(proxy, {
311                 model: me.model
312             });
313             
314             proxy = Ext.createByAlias('proxy.' + proxy.type, proxy);
315         }
316         
317         me.proxy = proxy;
318         
319         return me.proxy;
320     },
321
322 <span id='Ext-data-AbstractStore-method-getProxy'>    /**
323 </span>     * Returns the proxy currently attached to this proxy instance
324      * @return {Ext.data.proxy.Proxy} The Proxy instance
325      */
326     getProxy: function() {
327         return this.proxy;
328     },
329
330     //saves any phantom records
331     create: function(data, options) {
332         var me = this,
333             instance = Ext.ModelManager.create(Ext.applyIf(data, me.modelDefaults), me.model.modelName),
334             operation;
335         
336         options = options || {};
337
338         Ext.applyIf(options, {
339             action : 'create',
340             records: [instance]
341         });
342
343         operation = Ext.create('Ext.data.Operation', options);
344
345         me.proxy.create(operation, me.onProxyWrite, me);
346         
347         return instance;
348     },
349
350     read: function() {
351         return this.load.apply(this, arguments);
352     },
353
354     onProxyRead: Ext.emptyFn,
355
356     update: function(options) {
357         var me = this,
358             operation;
359         options = options || {};
360
361         Ext.applyIf(options, {
362             action : 'update',
363             records: me.getUpdatedRecords()
364         });
365
366         operation = Ext.create('Ext.data.Operation', options);
367
368         return me.proxy.update(operation, me.onProxyWrite, me);
369     },
370
371 <span id='Ext-data-AbstractStore-method-onProxyWrite'>    /**
372 </span>     * @private
373      * Callback for any write Operation over the Proxy. Updates the Store's MixedCollection to reflect
374      * the updates provided by the Proxy
375      */
376     onProxyWrite: function(operation) {
377         var me = this,
378             success = operation.wasSuccessful(),
379             records = operation.getRecords();
380
381         switch (operation.action) {
382             case 'create':
383                 me.onCreateRecords(records, operation, success);
384                 break;
385             case 'update':
386                 me.onUpdateRecords(records, operation, success);
387                 break;
388             case 'destroy':
389                 me.onDestroyRecords(records, operation, success);
390                 break;
391         }
392
393         if (success) {
394             me.fireEvent('write', me, operation);
395             me.fireEvent('datachanged', me);
396         }
397         //this is a callback that would have been passed to the 'create', 'update' or 'destroy' function and is optional
398         Ext.callback(operation.callback, operation.scope || me, [records, operation, success]);
399     },
400
401
402     //tells the attached proxy to destroy the given records
403     destroy: function(options) {
404         var me = this,
405             operation;
406             
407         options = options || {};
408
409         Ext.applyIf(options, {
410             action : 'destroy',
411             records: me.getRemovedRecords()
412         });
413
414         operation = Ext.create('Ext.data.Operation', options);
415
416         return me.proxy.destroy(operation, me.onProxyWrite, me);
417     },
418
419 <span id='Ext-data-AbstractStore-method-onBatchOperationComplete'>    /**
420 </span>     * @private
421      * Attached as the 'operationcomplete' event listener to a proxy's Batch object. By default just calls through
422      * to onProxyWrite.
423      */
424     onBatchOperationComplete: function(batch, operation) {
425         return this.onProxyWrite(operation);
426     },
427
428 <span id='Ext-data-AbstractStore-method-onBatchComplete'>    /**
429 </span>     * @private
430      * Attached as the 'complete' event listener to a proxy's Batch object. Iterates over the batch operations
431      * and updates the Store's internal data MixedCollection.
432      */
433     onBatchComplete: function(batch, operation) {
434         var me = this,
435             operations = batch.operations,
436             length = operations.length,
437             i;
438
439         me.suspendEvents();
440
441         for (i = 0; i &lt; length; i++) {
442             me.onProxyWrite(operations[i]);
443         }
444
445         me.resumeEvents();
446
447         me.fireEvent('datachanged', me);
448     },
449
450     onBatchException: function(batch, operation) {
451         // //decide what to do... could continue with the next operation
452         // batch.start();
453         //
454         // //or retry the last operation
455         // batch.retry();
456     },
457
458 <span id='Ext-data-AbstractStore-method-filterNew'>    /**
459 </span>     * @private
460      * Filter function for new records.
461      */
462     filterNew: function(item) {
463         // only want phantom records that are valid
464         return item.phantom === true &amp;&amp; item.isValid();
465     },
466
467 <span id='Ext-data-AbstractStore-method-getNewRecords'>    /**
468 </span>     * Returns all Model instances that are either currently a phantom (e.g. have no id), or have an ID but have not
469      * yet been saved on this Store (this happens when adding a non-phantom record from another Store into this one)
470      * @return {Array} The Model instances
471      */
472     getNewRecords: function() {
473         return [];
474     },
475
476 <span id='Ext-data-AbstractStore-method-getUpdatedRecords'>    /**
477 </span>     * Returns all Model instances that have been updated in the Store but not yet synchronized with the Proxy
478      * @return {Array} The updated Model instances
479      */
480     getUpdatedRecords: function() {
481         return [];
482     },
483
484 <span id='Ext-data-AbstractStore-method-filterUpdated'>    /**
485 </span>     * @private
486      * Filter function for updated records.
487      */
488     filterUpdated: function(item) {
489         // only want dirty records, not phantoms that are valid
490         return item.dirty === true &amp;&amp; item.phantom !== true &amp;&amp; item.isValid();
491     },
492
493 <span id='Ext-data-AbstractStore-method-getRemovedRecords'>    /**
494 </span>     * Returns any records that have been removed from the store but not yet destroyed on the proxy.
495      * @return {Array} The removed Model instances
496      */
497     getRemovedRecords: function() {
498         return this.removed;
499     },
500
501     filter: function(filters, value) {
502
503     },
504
505 <span id='Ext-data-AbstractStore-method-decodeFilters'>    /**
506 </span>     * @private
507      * Normalizes an array of filter objects, ensuring that they are all Ext.util.Filter instances
508      * @param {Array} filters The filters array
509      * @return {Array} Array of Ext.util.Filter objects
510      */
511     decodeFilters: function(filters) {
512         if (!Ext.isArray(filters)) {
513             if (filters === undefined) {
514                 filters = [];
515             } else {
516                 filters = [filters];
517             }
518         }
519
520         var length = filters.length,
521             Filter = Ext.util.Filter,
522             config, i;
523
524         for (i = 0; i &lt; length; i++) {
525             config = filters[i];
526
527             if (!(config instanceof Filter)) {
528                 Ext.apply(config, {
529                     root: 'data'
530                 });
531
532                 //support for 3.x style filters where a function can be defined as 'fn'
533                 if (config.fn) {
534                     config.filterFn = config.fn;
535                 }
536
537                 //support a function to be passed as a filter definition
538                 if (typeof config == 'function') {
539                     config = {
540                         filterFn: config
541                     };
542                 }
543
544                 filters[i] = new Filter(config);
545             }
546         }
547
548         return filters;
549     },
550
551     clearFilter: function(supressEvent) {
552
553     },
554
555     isFiltered: function() {
556
557     },
558
559     filterBy: function(fn, scope) {
560
561     },
562     
563 <span id='Ext-data-AbstractStore-method-sync'>    /**
564 </span>     * Synchronizes the Store with its Proxy. This asks the Proxy to batch together any new, updated
565      * and deleted records in the store, updating the Store's internal representation of the records
566      * as each operation completes.
567      */
568     sync: function() {
569         var me        = this,
570             options   = {},
571             toCreate  = me.getNewRecords(),
572             toUpdate  = me.getUpdatedRecords(),
573             toDestroy = me.getRemovedRecords(),
574             needsSync = false;
575
576         if (toCreate.length &gt; 0) {
577             options.create = toCreate;
578             needsSync = true;
579         }
580
581         if (toUpdate.length &gt; 0) {
582             options.update = toUpdate;
583             needsSync = true;
584         }
585
586         if (toDestroy.length &gt; 0) {
587             options.destroy = toDestroy;
588             needsSync = true;
589         }
590
591         if (needsSync &amp;&amp; me.fireEvent('beforesync', options) !== false) {
592             me.proxy.batch(options, me.getBatchListeners());
593         }
594     },
595
596
597 <span id='Ext-data-AbstractStore-method-getBatchListeners'>    /**
598 </span>     * @private
599      * Returns an object which is passed in as the listeners argument to proxy.batch inside this.sync.
600      * This is broken out into a separate function to allow for customisation of the listeners
601      * @return {Object} The listeners object
602      */
603     getBatchListeners: function() {
604         var me = this,
605             listeners = {
606                 scope: me,
607                 exception: me.onBatchException
608             };
609
610         if (me.batchUpdateMode == 'operation') {
611             listeners.operationcomplete = me.onBatchOperationComplete;
612         } else {
613             listeners.complete = me.onBatchComplete;
614         }
615
616         return listeners;
617     },
618
619     //deprecated, will be removed in 5.0
620     save: function() {
621         return this.sync.apply(this, arguments);
622     },
623
624 <span id='Ext-data-AbstractStore-method-load'>    /**
625 </span>     * Loads the Store using its configured {@link #proxy}.
626      * @param {Object} options Optional config object. This is passed into the {@link Ext.data.Operation Operation}
627      * object that is created and then sent to the proxy's {@link Ext.data.proxy.Proxy#read} function
628      */
629     load: function(options) {
630         var me = this,
631             operation;
632
633         options = options || {};
634
635         Ext.applyIf(options, {
636             action : 'read',
637             filters: me.filters.items,
638             sorters: me.getSorters()
639         });
640         
641         operation = Ext.create('Ext.data.Operation', options);
642
643         if (me.fireEvent('beforeload', me, operation) !== false) {
644             me.loading = true;
645             me.proxy.read(operation, me.onProxyLoad, me);
646         }
647         
648         return me;
649     },
650
651 <span id='Ext-data-AbstractStore-method-afterEdit'>    /**
652 </span>     * @private
653      * A model instance should call this method on the Store it has been {@link Ext.data.Model#join joined} to.
654      * @param {Ext.data.Model} record The model instance that was edited
655      */
656     afterEdit : function(record) {
657         var me = this;
658         
659         if (me.autoSync) {
660             me.sync();
661         }
662         
663         me.fireEvent('update', me, record, Ext.data.Model.EDIT);
664     },
665
666 <span id='Ext-data-AbstractStore-method-afterReject'>    /**
667 </span>     * @private
668      * A model instance should call this method on the Store it has been {@link Ext.data.Model#join joined} to..
669      * @param {Ext.data.Model} record The model instance that was edited
670      */
671     afterReject : function(record) {
672         this.fireEvent('update', this, record, Ext.data.Model.REJECT);
673     },
674
675 <span id='Ext-data-AbstractStore-method-afterCommit'>    /**
676 </span>     * @private
677      * A model instance should call this method on the Store it has been {@link Ext.data.Model#join joined} to.
678      * @param {Ext.data.Model} record The model instance that was edited
679      */
680     afterCommit : function(record) {
681         this.fireEvent('update', this, record, Ext.data.Model.COMMIT);
682     },
683
684     clearData: Ext.emptyFn,
685
686     destroyStore: function() {
687         var me = this;
688         
689         if (!me.isDestroyed) {
690             if (me.storeId) {
691                 Ext.data.StoreManager.unregister(me);
692             }
693             me.clearData();
694             me.data = null;
695             me.tree = null;
696             // Ext.destroy(this.proxy);
697             me.reader = me.writer = null;
698             me.clearListeners();
699             me.isDestroyed = true;
700
701             if (me.implicitModel) {
702                 Ext.destroy(me.model);
703             }
704         }
705     },
706     
707     doSort: function(sorterFn) {
708         var me = this;
709         if (me.remoteSort) {
710             //the load function will pick up the new sorters and request the sorted data from the proxy
711             me.load();
712         } else {
713             me.data.sortBy(sorterFn);
714             me.fireEvent('datachanged', me);
715         }
716     },
717
718     getCount: Ext.emptyFn,
719
720     getById: Ext.emptyFn,
721     
722 <span id='Ext-data-AbstractStore-method-removeAll'>    /**
723 </span>     * Removes all records from the store. This method does a &quot;fast remove&quot;,
724      * individual remove events are not called. The {@link #clear} event is
725      * fired upon completion.
726      * @method
727      */
728     removeAll: Ext.emptyFn,
729     // individual substores should implement a &quot;fast&quot; remove
730     // and fire a clear event afterwards
731
732 <span id='Ext-data-AbstractStore-method-isLoading'>    /**
733 </span>     * Returns true if the Store is currently performing a load operation
734      * @return {Boolean} True if the Store is currently loading
735      */
736     isLoading: function() {
737         return this.loading;
738      }
739 });
740 </pre>
741 </body>
742 </html>