Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/docs/source/Store.html view on Meta::CPAN
} else {
this.modified.splice(this.modified.indexOf(rs), 1);
}
},
<span id='Ext-data-Store-method-reMap'> // remap record ids in MixedCollection after records have been realized. @see Store#onCreateRecords, @see DataReader#realize
</span> reMap : function(record) {
if (Ext.isArray(record)) {
for (var i = 0, len = record.length; i < len; i++) {
this.reMap(record[i]);
}
} else {
delete this.data.map[record._phid];
this.data.map[record.id] = record;
var index = this.data.keys.indexOf(record._phid);
this.data.keys.splice(index, 1, record.id);
delete record._phid;
}
},
<span id='Ext-data-Store-method-onCreateRecords'> // @protected onCreateRecord proxy callback for create action
</span> onCreateRecords : function(success, rs, data) {
if (success === true) {
try {
this.reader.realize(rs, data);
}
catch (e) {
this.handleException(e);
if (Ext.isArray(rs)) {
// Recurse to run back into the try {}. DataReader#realize splices-off the rs until empty.
this.onCreateRecords(success, rs, data);
}
}
}
},
<span id='Ext-data-Store-method-onUpdateRecords'> // @protected, onUpdateRecords proxy callback for update action
</span> onUpdateRecords : function(success, rs, data) {
if (success === true) {
try {
this.reader.update(rs, data);
} catch (e) {
this.handleException(e);
if (Ext.isArray(rs)) {
// Recurse to run back into the try {}. DataReader#update splices-off the rs until empty.
this.onUpdateRecords(success, rs, data);
}
}
}
},
<span id='Ext-data-Store-method-onDestroyRecords'> // @protected onDestroyRecords proxy callback for destroy action
</span> onDestroyRecords : function(success, rs, data) {
// splice each rec out of this.removed
rs = (rs instanceof Ext.data.Record) ? [rs] : [].concat(rs);
for (var i=0,len=rs.length;i<len;i++) {
this.removed.splice(this.removed.indexOf(rs[i]), 1);
}
if (success === false) {
// put records back into store if remote destroy fails.
// @TODO: Might want to let developer decide.
for (i=rs.length-1;i>=0;i--) {
this.insert(rs[i].lastIndex, rs[i]); // <-- lastIndex set in Store#destroyRecord
}
}
},
<span id='Ext-data-Store-method-handleException'> // protected handleException. Possibly temporary until Ext framework has an exception-handler.
</span> handleException : function(e) {
// @see core/Error.js
Ext.handleError(e);
},
<span id='Ext-data-Store-method-reload'> /**
</span> * <p>Reloads the Record cache from the configured Proxy using the configured
* {@link Ext.data.Reader Reader} and the options from the last load operation
* performed.</p>
* <p><b>Note</b>: see the Important note in {@link #load}.</p>
* @param {Object} options <p>(optional) An <tt>Object</tt> containing
* {@link #load loading options} which may override the {@link #lastOptions options}
* used in the last {@link #load} operation. See {@link #load} for details
* (defaults to <tt>null</tt>, in which case the {@link #lastOptions} are
* used).</p>
* <br><p>To add new params to the existing params:</p><pre><code>
lastOptions = myStore.lastOptions;
Ext.apply(lastOptions.params, {
myNewParam: true
});
myStore.reload(lastOptions);
* </code></pre>
*/
reload : function(options){
this.load(Ext.applyIf(options||{}, this.lastOptions));
},
<span id='Ext-data-Store-method-loadRecords'> // private
</span> // Called as a callback by the Reader during a load operation.
loadRecords : function(o, options, success){
var i, len;
if (this.isDestroyed === true) {
return;
}
if(!o || success === false){
if(success !== false){
this.fireEvent('load', this, [], options);
}
if(options.callback){
options.callback.call(options.scope || this, [], options, false, o);
}
return;
}
var r = o.records, t = o.totalRecords || r.length;
if(!options || options.add !== true){
if(this.pruneModifiedRecords){
this.modified = [];
}
for(i = 0, len = r.length; i < len; i++){
r[i].join(this);
}
if(this.snapshot){
( run in 0.404 second using v1.01-cache-2.11-cpan-119454b85a5 )