PDA

View Full Version : disable store.pageMap on buffered grids?



gtsafas
5 Oct 2012, 9:49 AM
Hi, I want the request data from the backend everytime I scroll. My data is changing constantly behind the scenes and when a user scrolls I want the updated. I dont care if it is more expensive. I used to just call a Ext.getCmp('id').store.pageMap.clear() but now it appears to move the scrollbar to the top which I want to avoid.

Is there a better way to do this?

mitchellsimoens
10 Oct 2012, 9:27 AM
Have you tried using the purgePageCount config on the store?

gtsafas
10 Oct 2012, 12:57 PM
I looked at what prune() does and just created my own method to clearPages doing similiar logic.

I did look at purgePageCount but it didnt seem to work how I needed it. If there is a proper method to do it please let me know

I am just doing the following,



Ext.override(Ext.data.Store, { 'clearPageMap': function() {
var p = this.pageMap;
var pml = a.length;
for (;pm.first&&pml;pml--) {
pm.removeAtKey(pml.first.key);
}
}});