Author Topic: SUGGESTION - Lazy loading with scrolling from remote data  (Read 308 times)

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
SUGGESTION - Lazy loading with scrolling from remote data
« on: January 01, 2024, 10:12:49 pm »
I was looking at lazy loading with scrolling (your example here https://paramquery.com/pro/demos/infinite_scroll).

Your demo has 688 rows and loads 100 rows a page at a time.  The issue is that if I want to scroll to the last row I have to scroll to the bottom 6 times, and the scroll bar is incorrect as it is only proportional for what has loaded, not the amount of rows (688 in this case).

In another grid (jqGrid which is awful, thus the switch to you), all the rows below and out of view are accounted for and the scroll bar is the correct proportion.  The huge issue with jqGrid is that if you scroll to the bottom (CTRL+END), it loads every page between as well, which is beyond dumb (I said it was awful) and needlessly uses server resources.

A better approach would be waiting for scrolling to end with lets say a 100ms timeout, then to load the view page(s) (it might be 2 as the scrolled position might be between pages) if they haven't already been loaded.  A better solution instead of pages, is to use the index of the first row in view with no data loaded and number of rows after that to load.

I know a new lazy loading is coming, any idea when as we want to start to switchover to pqGrid sooner rather than later?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6307
    • View Profile
Re: SUGGESTION - Lazy loading with scrolling from remote data
« Reply #1 on: January 02, 2024, 11:00:12 am »
There are more than one examples for lazy loading in grid.

Example for Lazy loading more suitable for your requirements are here:

https://paramquery.com/pro/demos/virtual_scroll

https://paramquery.com/pro/demos87/virtual_scroll
« Last Edit: January 02, 2024, 11:44:22 am by paramvir »