Buffered Render Grid with buffered store shows the loading for event
We are trying to understand how buffered store leading and trailing buffer zone effect the maximum cache size of records. Please find our test data below.
1) Why is the scenario of pageSize:50 and purgePageCount: 1 not working? Is there some edge case behavior need to be taken care or do we need to follow some rules associated with pageSize, purgePageCount and buffer zones?
2)Can somebody explain the logic associated with the max size of contacts in page for a scenario of purgePageCount: 2 and different PageSize 50, 100, 250 to be 250,400 and 800. How is buffer zone effecting the calculation of maximum contacts in the cache
When I run your test case, I definitely see the issue, and in 4.2.2 as well. It seems to affect the page cache when the grid is first starting out, limiting it to the purgePageCount instead of the purgePageCount+required buffered range. This seems to have been fixed in 4.2.3, however -- your test case runs as expected.
I personally don't know all of the math involved in calculating the required buffer range. The docs for pageSize and purgePageCount indicate it is based on pagesize, leadingBufferZone and trailingBufferZone. I guess the real answer is in the code, but you might have at this page in the distribution, which can help you see what's going on with infinite scrolling and easily play with the numbers:
I ran into similar situation as well.
Thank you for the fiddle example. It really helped me understanding the problem.
When I was playing with your fiddle, and I think I have an answer for your question #1.
BufferedRenderer calculates its "viewSize" using the following math (onViewSize method in Ext.grid.plugin.BufferedRenderer).
Math.ceil(height / me.rowHeight) + me.trailingBufferZone + me.leadingBufferZone;
For your fiddle, your grid's height is 450.
rowHeight is 21.
trailingBufferZone is 10 by default.
leadingBufferZone is 20 by default.
So your viewSize is 52.
Now, your pageSize is 50 which is less than 52.
And you are loading only 1 page because your purgePageCount is 1.
This causes infinite loading mask.
So when you set pageSize to 53, it should work fine.
Now, when you set purgePageCount = 2, you load 2 pages with each size 50. So you have 50 * 2 = 100 items which is greater than viewSize 52. So you don't see infinite loading mask problem here.
That means when you set your pageSize to be 25 with purgePageCount = 2, you will hit the infinite loading mask problem again.. because 25 * 2 = 50 < viewSize 52.
NOW!! We know that if we have items that are bigger than viewSize, we don't have infinite loading mask problem.
What if # item is exactly same as viewSize? For example, pageSize = 52 with purgePageCount = 1 (or pageSize = 26 with purgePageCount = 2)?
It throws an exception!!!!!
I think this is a bug with GridView or Buffered Store. I really didn't dig that further.