user2867876
user2867876

Reputation: 21

JQGrid using scroll:1 does not work on large datasets (1 million records)

I have been using JQGrid for a long time and recently ran into a problem when using a large recordset. The automatic paging that occurs when you use the scroll:1 option stops working when the recordset contains approx more than 1 million records. (I have tested 700K - it works and 1.1 million and it does not work). I am requesting just 50 records at a time.

If I change to scroll:false, it displays the pager and it functions properly. Using scroll: true also does not work.

By not working, I mean that I can only scroll through the first page of records requested. Scrolling down does not cause JQGrid to request the next page of records.

Anyone found a workaround? I am using the latest version of jqgrid. Thanks!

Upvotes: 2

Views: 404

Answers (1)

kazmer
kazmer

Reputation: 521

The root of the problem is that every number in JavaScript is a 64 bit floating point number.

When you look at the generated table with FireBug, you'll see, that inside the ui-jqgrid-bdiv there is a div with it's height set to rowHeight*records pixels, and when it gets large enough, it's represented in floating point form, like 7.22834e+7px for about 3 million rows.

The jqGrid writers use a lot of parseInt(), and parseInt(7.22834e+7) == 7, so my guess is that the calculation goes sideways from there. The grid simply thinks it has loaded all of your data when you scroll down to the bottom.

I tried to set rowNum to a large number, but it still loads only the first batch of data.

I'm sorry, but I don't think there is a workaround, other than setting scroll=false.

Upvotes: 1

Related Questions