Try this override
Code:
Ext.override(Ext.data.Store.prototype.PageMap, {
forEach: function(fn, scope) {
var me = this,
pageNumbers = Ext.Object.getKeys(me.map),
pageCount = pageNumbers.length,
i, j,
pageNumber,
page,
pageSize;
for (i = 0; i < pageCount; i++) {
pageNumbers[i] = Number(pageNumbers[i]);
}
Ext.Array.sort(pageNumbers);
scope = scope || me;
for (i = 0; i < pageCount; i++) {
pageNumber = pageNumbers[i];
page = me.getPage(pageNumber);
pageSize = page.length;
for (j = 0; j < pageSize; j++) {
if (fn.call(scope, page[j], (pageNumber - 1) * me.pageSize + j) === false) {
return;
}
}
}
},
/**
* Returns the first record in this page map which elicits a true return value from the
* passed selection function.
*
* *IMPORTANT
* This can ONLY find records which happen to be cached in the page cache. This will be parts of the dataset around the currently
* visible zone, or recently visited zones if the pages have not yet been purged from the cache.
*
* This CAN NOT find records which have not been loaded into the cache.*
*
* If full client side searching is required, do not use a buffered store, instead use a regular, fully loaded store and
* use the {@link Ext.grid.plugin.BufferedRenderer BufferedRenderer} plugin to minimize DOM footprint.
* @param {Function} fn The selection function to execute for each item.
* @param {Mixed} fn.rec The record.
* @param {Mixed} fn.index The index in the total dataset of the record.
* @param {Object} [scope] The scope (`this` reference) in which the function is executed. Defaults to this PageMap.
* @return {Object} The first record in this page map which returned true from the selection
* function, or null if none was found.
*/
findBy: function(fn, scope) {
var me = this,
result = null;
scope = scope || me;
me.forEach(function(rec, index) {
if (fn.call(scope, rec, index)) {
result = rec;
return false;
}
});
return result;
},
/**
* Returns the index *in the whole dataset* of the first record in this page map which elicits a true return value from the
* passed selection function.
*
* *IMPORTANT
* This can ONLY find records which happen to be cached in the page cache. This will be parts of the dataset around the currently
* visible zone, or recently visited zones if the pages have not yet been purged from the cache.
*
* This CAN NOT find records which have not been loaded into the cache.*
*
* If full client side searching is required, do not use a buffered store, instead use a regular, fully loaded store and
* use the {@link Ext.grid.plugin.BufferedRenderer BufferedRenderer} plugin to minimize DOM footprint.
* @param {Function} fn The selection function to execute for each item.
* @param {Mixed} fn.rec The record.
* @param {Mixed} fn.index The index in the total dataset of the record.
* @param {Object} [scope] The scope (`this` reference) in which the function is executed. Defaults to this PageMap.
* @return {Number} The index first record in this page map which returned true from the selection
* function, or -1 if none was found.
*/
findIndexBy: function(fn, scope) {
var me = this,
result = -1;
scope = scope || me;
me.forEach(function(rec, index) {
if (fn.call(scope, rec)) {
result = index;
return false;
}
});
return result;
}
});