PDA

View Full Version : buffered grid - buffered store in Ext 4.1b2



Moinsen
21 Feb 2012, 1:26 AM
Hi,

i have a buffered grid which works perfect in Ext Js 3.4 and 4.07. The data is fetched during scrolling in 100 blocks and displayed in the grid. In 4.1b2 it stops after the first block and hangs. The second data block is ok as i can see in Firebug. I read about this issue here in the Forum before.

Please let me know if there is a fix or a workaround for this. Maybe the API changed?

Thanks!

mitchellsimoens
21 Feb 2012, 5:15 AM
I'm unsure about your issue. Launching the example for the buffered grid, it is working just fine.

Moinsen
22 Feb 2012, 12:44 AM
In the buffered grid example you are working with: store.cacheRecords(records);
Our 'buffered grid' is working with a own proxy. It looks like this:

Ext.define('MyProxy', {
extend: 'Ext.data.AjaxProxy',
constructor: function(config) {
MyProxy.superclass.constructor.call(this, config);
this.initConfig(config);
logInfo("MyProxy.constructor()");
},
doRequest: function(operation, callback, scope) {
logInfo("MyProxy.doRequest() starts");

pageRequest(operation, callback, scope);
logInfo("MyProxy.doRequest() ends");
return;
}
});

So doRequest is triggered by verticalScrollerType: 'paginggridscroller' from the grid. If you scroll down at a certain point a new doRequest is triggered and the next 100 records are added to the grid. pageRequest is controlled by operation.page and operation.limit and delivers the next records with a database request.
To start the whole thing its enough to say: bufferStore.guaranteeRange(0, count -1);

Hope this makes it clear. Thank you!

Moinsen
28 Feb 2012, 3:55 AM
I tested it with 4.1b3. Now guaranteeRange even not starts the first doRequest on the proxy. So the behavior for buffered 'Reading' changes each build.

Please let me know how to do buffered reading now. It cannot use cacheRecords because there are some ten thousand records to fetch. So i have to fetch them in handy blocks.



/:)

dongryphon
6 Mar 2012, 5:16 PM
The guaranteeRange method had been broken in 4.1 for sometime, but should be fixed in the next build (the fixes are already in the nightly build).

See http://www.sencha.com/forum/showthread.php?185483-Grid-buffered-infinite-scrolling-in-4.1