-<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-data.AbstractStore'>/**
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>The source code</title>
+ <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../prettify/prettify.js"></script>
+ <style type="text/css">
+ .highlight { display: block; background-color: #ddd; }
+ </style>
+ <script type="text/javascript">
+ function highlight() {
+ document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+ }
+ </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+ <pre class="prettyprint lang-js"><span id='Ext-data-AbstractStore'>/**
</span> * @author Ed Spencer
* @class Ext.data.AbstractStore
*
remoteSort : false,
remoteFilter: false,
-<span id='Ext-data.AbstractStore-cfg-proxy'> /**
+<span id='Ext-data-AbstractStore-cfg-proxy'> /**
</span> * @cfg {String/Ext.data.proxy.Proxy/Object} proxy The Proxy to use for this Store. This can be either a string, a config
* object or a Proxy instance - see {@link #setProxy} for details.
*/
-<span id='Ext-data.AbstractStore-cfg-autoLoad'> /**
+<span id='Ext-data-AbstractStore-cfg-autoLoad'> /**
</span> * @cfg {Boolean/Object} autoLoad If data is not specified, and if autoLoad is true or an Object, this store's load method
* is automatically called after creation. If the value of autoLoad is an Object, this Object will be passed to the store's
* load method. Defaults to false.
*/
autoLoad: false,
-<span id='Ext-data.AbstractStore-cfg-autoSync'> /**
+<span id='Ext-data-AbstractStore-cfg-autoSync'> /**
</span> * @cfg {Boolean} autoSync True to automatically sync the Store with its Proxy after every edit to one of its Records.
* Defaults to false.
*/
autoSync: false,
-<span id='Ext-data.AbstractStore-property-batchUpdateMode'> /**
+<span id='Ext-data-AbstractStore-property-batchUpdateMode'> /**
</span> * Sets the updating behavior based on batch synchronization. 'operation' (the default) will update the Store's
* internal representation of the data after each operation of the batch has completed, 'complete' will wait until
* the entire batch has been completed before updating the Store's data. 'complete' is a good choice for local
*/
batchUpdateMode: 'operation',
-<span id='Ext-data.AbstractStore-property-filterOnLoad'> /**
+<span id='Ext-data-AbstractStore-property-filterOnLoad'> /**
</span> * If true, any filters attached to this Store will be run after loading data, before the datachanged event is fired.
* Defaults to true, ignored if {@link #remoteFilter} is true
* @property filterOnLoad
*/
filterOnLoad: true,
-<span id='Ext-data.AbstractStore-property-sortOnLoad'> /**
+<span id='Ext-data-AbstractStore-property-sortOnLoad'> /**
</span> * If true, any sorters attached to this Store will be run after loading data, before the datachanged event is fired.
* Defaults to true, igored if {@link #remoteSort} is true
* @property sortOnLoad
*/
sortOnLoad: true,
-<span id='Ext-data.AbstractStore-property-implicitModel'> /**
+<span id='Ext-data-AbstractStore-property-implicitModel'> /**
</span> * True if a model was created implicitly for this Store. This happens if a fields array is passed to the Store's constructor
* instead of a model constructor or name.
* @property implicitModel
*/
implicitModel: false,
-<span id='Ext-data.AbstractStore-property-defaultProxyType'> /**
+<span id='Ext-data-AbstractStore-property-defaultProxyType'> /**
</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}.
* @property defaultProxyType
* @type String
*/
defaultProxyType: 'memory',
-<span id='Ext-data.AbstractStore-property-isDestroyed'> /**
+<span id='Ext-data-AbstractStore-property-isDestroyed'> /**
</span> * True if the Store has already been destroyed via {@link #destroyStore}. If this is true, the reference to Store should be deleted
* as it will not function correctly any more.
* @property isDestroyed
isStore: true,
-<span id='Ext-data.AbstractStore-cfg-storeId'> /**
+<span id='Ext-data-AbstractStore-cfg-storeId'> /**
</span> * @cfg {String} storeId Optional unique identifier for this store. If present, this Store will be registered with
* the {@link Ext.data.StoreManager}, making it easy to reuse elsewhere. Defaults to undefined.
*/
-<span id='Ext-data.AbstractStore-cfg-fields'> /**
+<span id='Ext-data-AbstractStore-cfg-fields'> /**
</span> * @cfg {Array} fields
* This may be used in place of specifying a {@link #model} configuration. The fields should be a
* set of {@link Ext.data.Field} configuration objects. The store will automatically create a {@link Ext.data.Model}
//documented above
constructor: function(config) {
- var me = this;
+ var me = this,
+ filters;
me.addEvents(
-<span id='Ext-data.AbstractStore-event-add'> /**
+<span id='Ext-data-AbstractStore-event-add'> /**
</span> * @event add
* Fired when a Model instance has been added to this Store
* @param {Ext.data.Store} store The store
*/
'add',
-<span id='Ext-data.AbstractStore-event-remove'> /**
+<span id='Ext-data-AbstractStore-event-remove'> /**
</span> * @event remove
* Fired when a Model instance has been removed from this Store
* @param {Ext.data.Store} store The Store object
*/
'remove',
-<span id='Ext-data.AbstractStore-event-update'> /**
+<span id='Ext-data-AbstractStore-event-update'> /**
</span> * @event update
* Fires when a Record has been updated
* @param {Store} this
*/
'update',
-<span id='Ext-data.AbstractStore-event-datachanged'> /**
+<span id='Ext-data-AbstractStore-event-datachanged'> /**
</span> * @event datachanged
* Fires whenever the records in the Store have changed in some way - this could include adding or removing records,
* or updating the data in existing records
*/
'datachanged',
-<span id='Ext-data.AbstractStore-event-beforeload'> /**
+<span id='Ext-data-AbstractStore-event-beforeload'> /**
</span> * @event beforeload
* Event description
* @param {Ext.data.Store} store This Store
*/
'beforeload',
-<span id='Ext-data.AbstractStore-event-load'> /**
+<span id='Ext-data-AbstractStore-event-load'> /**
</span> * @event load
* Fires whenever the store reads data from a remote data source.
* @param {Ext.data.Store} this
*/
'load',
-<span id='Ext-data.AbstractStore-event-beforesync'> /**
+<span id='Ext-data-AbstractStore-event-beforesync'> /**
</span> * @event beforesync
* Called before a call to {@link #sync} is executed. Return false from any listener to cancel the synv
* @param {Object} options Hash of all records to be synchronized, broken down into create, update and destroy
*/
'beforesync',
-<span id='Ext-data.AbstractStore-event-clear'> /**
+<span id='Ext-data-AbstractStore-event-clear'> /**
</span> * @event clear
* Fired after the {@link #removeAll} method is called.
* @param {Ext.data.Store} this
);
Ext.apply(me, config);
+ // don't use *config* anymore from here on... use *me* instead...
-<span id='Ext-data.AbstractStore-property-removed'> /**
+<span id='Ext-data-AbstractStore-property-removed'> /**
</span> * Temporary cache in which removed model instances are kept until successfully synchronised with a Proxy,
* at which point this is cleared.
* @private
me.removed = [];
me.mixins.observable.constructor.apply(me, arguments);
- me.model = Ext.ModelManager.getModel(config.model || me.model);
+ me.model = Ext.ModelManager.getModel(me.model);
-<span id='Ext-data.AbstractStore-property-modelDefaults'> /**
+<span id='Ext-data-AbstractStore-property-modelDefaults'> /**
</span> * @property modelDefaults
* @type Object
* @private
}
//ensures that the Proxy is instantiated correctly
- me.setProxy(config.proxy || me.proxy || me.model.getProxy());
+ me.setProxy(me.proxy || me.model.getProxy());
if (me.id && !me.storeId) {
me.storeId = me.id;
me.mixins.sortable.initSortable.call(me);
-<span id='Ext-data.AbstractStore-property-filters'> /**
+<span id='Ext-data-AbstractStore-property-filters'> /**
</span> * The collection of {@link Ext.util.Filter Filters} currently applied to this Store
* @property filters
* @type Ext.util.MixedCollection
*/
+ filters = me.decodeFilters(me.filters);
me.filters = Ext.create('Ext.util.MixedCollection');
- me.filters.addAll(me.decodeFilters(config.filters));
+ me.filters.addAll(filters);
},
-<span id='Ext-data.AbstractStore-method-setProxy'> /**
+<span id='Ext-data-AbstractStore-method-setProxy'> /**
</span> * Sets the Store's Proxy by string, config object or Proxy instance
* @param {String|Object|Ext.data.proxy.Proxy} proxy The new Proxy, which can be either a type string, a configuration object
* or an Ext.data.proxy.Proxy instance
return me.proxy;
},
-<span id='Ext-data.AbstractStore-method-getProxy'> /**
+<span id='Ext-data-AbstractStore-method-getProxy'> /**
</span> * Returns the proxy currently attached to this proxy instance
* @return {Ext.data.proxy.Proxy} The Proxy instance
*/
return me.proxy.update(operation, me.onProxyWrite, me);
},
-<span id='Ext-data.AbstractStore-method-onProxyWrite'> /**
+<span id='Ext-data-AbstractStore-method-onProxyWrite'> /**
</span> * @private
* Callback for any write Operation over the Proxy. Updates the Store's MixedCollection to reflect
* the updates provided by the Proxy
return me.proxy.destroy(operation, me.onProxyWrite, me);
},
-<span id='Ext-data.AbstractStore-method-onBatchOperationComplete'> /**
+<span id='Ext-data-AbstractStore-method-onBatchOperationComplete'> /**
</span> * @private
* Attached as the 'operationcomplete' event listener to a proxy's Batch object. By default just calls through
* to onProxyWrite.
return this.onProxyWrite(operation);
},
-<span id='Ext-data.AbstractStore-method-onBatchComplete'> /**
+<span id='Ext-data-AbstractStore-method-onBatchComplete'> /**
</span> * @private
* Attached as the 'complete' event listener to a proxy's Batch object. Iterates over the batch operations
* and updates the Store's internal data MixedCollection.
// batch.retry();
},
-<span id='Ext-data.AbstractStore-method-filterNew'> /**
+<span id='Ext-data-AbstractStore-method-filterNew'> /**
</span> * @private
* Filter function for new records.
*/
return item.phantom === true && item.isValid();
},
-<span id='Ext-data.AbstractStore-method-getNewRecords'> /**
+<span id='Ext-data-AbstractStore-method-getNewRecords'> /**
</span> * Returns all Model instances that are either currently a phantom (e.g. have no id), or have an ID but have not
* yet been saved on this Store (this happens when adding a non-phantom record from another Store into this one)
* @return {Array} The Model instances
return [];
},
-<span id='Ext-data.AbstractStore-method-getUpdatedRecords'> /**
+<span id='Ext-data-AbstractStore-method-getUpdatedRecords'> /**
</span> * Returns all Model instances that have been updated in the Store but not yet synchronized with the Proxy
* @return {Array} The updated Model instances
*/
return [];
},
-<span id='Ext-data.AbstractStore-method-filterUpdated'> /**
+<span id='Ext-data-AbstractStore-method-filterUpdated'> /**
</span> * @private
* Filter function for updated records.
*/
return item.dirty === true && item.phantom !== true && item.isValid();
},
- //returns any records that have been removed from the store but not yet destroyed on the proxy
+<span id='Ext-data-AbstractStore-method-getRemovedRecords'> /**
+</span> * Returns any records that have been removed from the store but not yet destroyed on the proxy.
+ * @return {Array} The removed Model instances
+ */
getRemovedRecords: function() {
return this.removed;
},
},
-<span id='Ext-data.AbstractStore-method-decodeFilters'> /**
+<span id='Ext-data-AbstractStore-method-decodeFilters'> /**
</span> * @private
* Normalizes an array of filter objects, ensuring that they are all Ext.util.Filter instances
* @param {Array} filters The filters array
},
-<span id='Ext-data.AbstractStore-method-sync'> /**
+<span id='Ext-data-AbstractStore-method-sync'> /**
</span> * Synchronizes the Store with its Proxy. This asks the Proxy to batch together any new, updated
* and deleted records in the store, updating the Store's internal representation of the records
* as each operation completes.
},
-<span id='Ext-data.AbstractStore-method-getBatchListeners'> /**
+<span id='Ext-data-AbstractStore-method-getBatchListeners'> /**
</span> * @private
* Returns an object which is passed in as the listeners argument to proxy.batch inside this.sync.
* This is broken out into a separate function to allow for customisation of the listeners
return this.sync.apply(this, arguments);
},
-<span id='Ext-data.AbstractStore-method-load'> /**
+<span id='Ext-data-AbstractStore-method-load'> /**
</span> * Loads the Store using its configured {@link #proxy}.
* @param {Object} options Optional config object. This is passed into the {@link Ext.data.Operation Operation}
* object that is created and then sent to the proxy's {@link Ext.data.proxy.Proxy#read} function
return me;
},
-<span id='Ext-data.AbstractStore-method-afterEdit'> /**
+<span id='Ext-data-AbstractStore-method-afterEdit'> /**
</span> * @private
* A model instance should call this method on the Store it has been {@link Ext.data.Model#join joined} to.
* @param {Ext.data.Model} record The model instance that was edited
me.fireEvent('update', me, record, Ext.data.Model.EDIT);
},
-<span id='Ext-data.AbstractStore-method-afterReject'> /**
+<span id='Ext-data-AbstractStore-method-afterReject'> /**
</span> * @private
* A model instance should call this method on the Store it has been {@link Ext.data.Model#join joined} to..
* @param {Ext.data.Model} record The model instance that was edited
this.fireEvent('update', this, record, Ext.data.Model.REJECT);
},
-<span id='Ext-data.AbstractStore-method-afterCommit'> /**
+<span id='Ext-data-AbstractStore-method-afterCommit'> /**
</span> * @private
* A model instance should call this method on the Store it has been {@link Ext.data.Model#join joined} to.
* @param {Ext.data.Model} record The model instance that was edited
getById: Ext.emptyFn,
-<span id='Ext-data.AbstractStore-property-removeAll'> /**
+<span id='Ext-data-AbstractStore-method-removeAll'> /**
</span> * Removes all records from the store. This method does a "fast remove",
* individual remove events are not called. The {@link #clear} event is
* fired upon completion.
+ * @method
*/
removeAll: Ext.emptyFn,
// individual substores should implement a "fast" remove
// and fire a clear event afterwards
-<span id='Ext-data.AbstractStore-method-isLoading'> /**
+<span id='Ext-data-AbstractStore-method-isLoading'> /**
</span> * Returns true if the Store is currently performing a load operation
* @return {Boolean} True if the Store is currently loading
*/
return this.loading;
}
});
-</pre></pre></body></html>
\ No newline at end of file
+</pre>
+</body>
+</html>