PDA

View Full Version : infinite grid



rkim
16 Feb 2012, 2:26 PM
I am creating a infinite grid and for the start, I am totally coping the code in the sample
http://docs.sencha.com/ext-js/4-0/#!/example/grid/infinite-scroll.html
e (http://docs.sencha.com/ext-js/4-0/#!/example/grid/infinite-scroll.html)xcept that I am not using jsonp (using "ajax")

the page loads fine if I call,

store.load();
but
store.guaranteeRange(0,199) doesn't seem to request server.

Is this known issue for 4.1.0 beta 2 ?? sencha is using the latest beta for the sample ??

rkim
16 Feb 2012, 3:49 PM
Tried with jsonp, and still no go. It works fine with store.load().

From the documentation, verticalScrollerType doesn't exist. Do I need something to make this work ?

verticalScrollerType: 'paginggridscroller',

mxu
22 Feb 2012, 9:57 AM
yes, I got the same issue when using ajax call instead

Animal
26 Feb 2012, 3:17 PM
Don't use the code from the 4.0.7 example in code which runs on 4.1.0.

Use the code from your SDK's examples directory.

rkim
27 Feb 2012, 3:42 PM
just downloaded 4.1.0 beta 3.
infinite grid works in chrome, but not in firefox. (10.0.2)

Animal
29 Feb 2012, 5:49 AM
This has been extensively fixed in recent days to be much more reliable and efficient. The changes are not pulled into the repo yet though.

Right now, the example works well on all browsers including FF 10.

With the new code, you can use any pageSize you like, and it will request data in blocks of that size. It's a good idea to tune this and other parameters depending on your network latency and server and database speed.

Large page sizes are usually good because they can keep the page cache filled with plenty of data. But if the network is slow or database is slow, you may want smaller pages, but to change the leading and trailing buffer zones which is how much "spare" data to keep ahead of and behind the scroll position to enable scrolling to continue.

Large zones means that more data will be kept ahead to satisfy requirements for data.

In addition, there is a infinite grid tuning example where you can experiment with the complicated configurations that allow you to tune it for your requirements.

Animal
29 Feb 2012, 5:51 AM
The API is simpler. So to kick it off, you just do



myStore.loadPage(1);


And it routes that through the page cache, and begins buffered rendering.

rkim
29 Feb 2012, 2:24 PM
so.. is there any example ?

The example in 4.1.0-beta3 doesn't work

gilfeather
29 Feb 2012, 6:57 PM
Don't use the code from the 4.0.7 example in code which runs on 4.1.0.

Well, duh! Didn't everyone get the memo: "Each release of ExtJS requires all code to be rewritten." You can't use old code with a new version, are you people nuts! 8-|

Animal
1 Mar 2012, 3:25 AM
Sorry about that! But we are making the API much easier in 4.1.0. So the horror of current usage of buffered rendered grids will disappear.

Just configure your store with



buffered: true,
pageSize: <whatever works best for you>,
autoLoad: true


That's it. You don't have to interact with the machinery any more.

slemmon
1 Mar 2012, 7:27 AM
This sounds like good news to me. Will reloading the buffered store with a whole new dataset be pretty straightforward in 4.1?

Animal
1 Mar 2012, 11:49 AM
Not sure what you mean by that. A Store maps to a URL which references a certain query.

slemmon
1 Mar 2012, 11:54 AM
I was having some trouble refreshing a buffered store in 4.0.2 and had asked how to go about refreshing it in the following form post:
http://www.sencha.com/forum/showthread.php?143706-4.0.2a-Trouble-refreshing-a-buffered-store

A (http://www.sencha.com/forum/showthread.php?143706-4.0.2a-Trouble-refreshing-a-buffered-store)nd the answer seemed to be "Just wait until 4.1".

Animal
1 Mar 2012, 12:14 PM
I'd have to try it. Off the cuff, I'd say that in 4.1.0RC1 you'd do



myStore.pageMap.clear(); // Empty the entire page cache
myStore.loadPage(1);

slemmon
1 Mar 2012, 12:24 PM
That sounds great. I'll certainly be checking it out when the RC series launches.

Thx.

dongryphon
6 Mar 2012, 5:02 PM
Check out the new thread on grids and their API. In short, the guaranteeRange API will work in 4.1 RC1 though (to maintain compatibility with its current meaning), it is not recommended.

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