PDA

View Full Version : more infinite grid issues



pm100
29 Dec 2011, 11:37 AM
Seems like I must allow the grid to calculate pagesize - OK. I have to say that I dont like that. I might have very good reasons for wanting a small pagesize.

I have a dataset with 100 rows so the grid/store/scroller gets it all in one chunk (it asks for rows 0-323)

Most important issue is that the last line doesnt show. This is consistent, I only get 99 rows

Second issue: if I scroll up and then down again (by a few rows) the data gets reread. Is this by design? I dont think so - it happens because my record count (100) is less than the calculated endpoint (323) and so the second call to rangeSatisifed in store.guaranteeRange returns false. These calculations need to take totalCount into consideration

dongryphon
30 Dec 2011, 11:40 AM
@pm100,

Thanks for the details - they are very helpful!


Seems like I must allow the grid to calculate pagesize - OK. I have to say that I dont like that. I might have very good reasons for wanting a small pagesize.

I believe if you configure a pageSize on your store it will be respected. We no longer default a pageSize of 25.

The root issue is that if the page size is below the visible row count, the algorithm to manage this gets much harder. So that left us with these choices:

bite the bullet and make all page sizes work (which means requesting multiple pages to fill the viewing area)
make it the user's responsibility to ensure page size is large enough so that one page is enough to fill the viewing area
calculate the minimum amount of rows per page and let the user configure the extra
A hybrid of 2 and 3: default to calculating the pageSize but allow the user to configure it (this removes the old default pageSize of 25).

There are new configuration options that can help manage the calculation if you need to do so: trailingBufferZone and leadingBufferZone.


I have a dataset with 100 rows so the grid/store/scroller gets it all in one chunk (it asks for rows 0-323)

Most important issue is that the last line doesnt show. This is consistent, I only get 99 rows

I don't see this with our infinite grid example. Do you have a simple test case you could post?


Second issue: if I scroll up and then down again (by a few rows) the data gets reread. Is this by design? I dont think so - it happens because my record count (100) is less than the calculated endpoint (323) and so the second call to rangeSatisifed in store.guaranteeRange returns false. These calculations need to take totalCount into consideration

No that is not the desired behavior. A test case would be helpful here as well. Your descriptions is really helpful and much appreciated.

The test cases do more than help speed the process along though... they ensure that the problems you see and the problems we fix are the same :)

Thanks again!

pm100
30 Dec 2011, 11:46 AM
my problem is that I have a huge app and isolating test cases is not easy :-)

I will try to work out why the last line fails to display - I now know my way round that code

pm100
30 Dec 2011, 2:18 PM
the chopping of the last line is very consistent with the following setup

I have a data source with 100 rows
No pagesize set
I init the grid with guranteeRange(0,50)

Then I scroll to the end, I always end on row 99. If I try to scroll further down the handleViewScroll method is called but it calculates the wrong end

requestStart = Math.min(visibleStart - me.numFromEdge - me.trailingBufferZone, totalCount - renderedSize);

returns the seocnd value (total - renderedsize) (49)

it then does

if (requestStart !== undefined) {

requestStart = requestStart & ~1;
requestEnd = requestStart + renderedSize - 1;

This moves the start value to 48 and the end value to 98. And so it misses the last row

PrashanthShetty
13 Jan 2012, 12:22 PM
Hi,

We are using the EXTJS 4.1 Infinite Grid, We are facing the below issues.

Assume the Total Records in Grid is 150.Store Guaranteed Range is 0-99.
1.At the end of Store say after 140-150 row in Grid, If you add some new bulk rows(say more than 10) to store dynamically & when you scroll up, u will see blank rows.

Normal Infinite Grid with More than 1000 records
2.And If we do remote sort on any column Grid will show Empty Rows after guaranteed range(say 99 records), Once You scroll down completely if you scroll up, it will fill up that empty records(This issue can be reproduced even in infinite grid example also.)

This is a pathetic behaviour as the Grid looks very ugly with empty rows, is there any fix for the same.

3.One More Issue is, Specifically in IE Browser, we noticle major performance issue while performing store.removeAt(recIndex) for bulk records specially more than 10 records.(This is a generalised Grid issue, Not specific to infinite grid.)

Thanks,
Prashanth

Animal
17 Jan 2012, 10:23 AM
I've fixed the off by one error which meant the last row won't show up if the total dataset size is odd.

Remote sort now correctly moves you to page 1 of the dataset. It scrolls up to the top.

This is in the 4.1.0 codebase.

Removing multiple rows? Depending on how many, it might be faster to suspendEvents on the Store, remove the records, then resumeEvents and programatically refresh the View at the end.

This will simply rerender the view instead of removing each <tr> separately with all that may involve (index reassignment, row striping etc)