PDA

View Full Version : Buffered store not working



PKK
5 Jun 2012, 3:00 AM
I have this setup using loads of array formed data in buffered grid. It used to work in 4.0.2a but now in 4.1.0 this only loads page one and if I'm trying to scroll down, the browser will crash (ff, chrome). Setting the zone configs greater that page size will crash the browser before any data is rendered to the grid. Obviously I'm missing something here, but after hours of debugging and half blindly trying about everything, I can't fix this. Could anyone help me a bit?


var store = Ext.create('Ext.data.Store', {

idIndex: 1,
buffered: true,
pageSize: 200,
purgePageCount: 0,
model: 'resultModel',
proxy: {
type: 'memory',
data: myData, // array formed data
reader: {
type: 'array'
}
}});
var grid = Ext.create('Ext.grid.Panel', {
store: store,
verticalScroller: {
xtype: 'paginggridscroller',
trailingBufferZone: 10,
leadingBufferZone: 10,
activePrefetch: false
},
invalidateScrollerOnRefresh: false,
viewConfig: {
trackOver: true
},
loadMask: true,
trackMouseOver: true,
multiSelect: true,
title: 'Result Data',
stripeRows: true,
disableSelection: false,
height: 424,
layout: 'fit',
width: 300,
renderTo: 'resGrid'
});
store.loadPage(1); // store.guaranteeRange(0,199) does the same

PKK
5 Jun 2012, 10:39 PM
Found the solution. Basically, with my initial setup the page 1 was the 200 first rows. When the grid requested - as I believed - page 2, it was actually all the rest of the data instead of the next 200 rows. And as the amount of rows was ~100 k, you can quess the result... So, the solution was actually very simple - yet hard to find at first - just put the page size to the actual size of data.