0

I am working with React Ag Grid. I want to implement lazy loading with the grid.

But React Ag Grid does not provide lazy loading. It provides infinite scrolling but then it will not support filtering and sorting.

I am using tingodb (Nosql) db,

How can I achieve lazy loading with react ag grid?

TIA

Jee Mok
  • 6,157
  • 8
  • 47
  • 80
Mangesh Tak
  • 346
  • 1
  • 6
  • 22
  • 1
    See [ask], and especially [mcve]. The idea is you describe what you want to do, show what you tried, and tell us what results you get – Paritosh Jul 20 '18 at 07:44
  • Lazy loading is the same as infinite scrolling in this case. https://www.ag-grid.com/javascript-grid-infinite-scrolling/ says "The grid cannot do sorting or filtering for you, as it does not have all of the data. Sorting or filtering must be done on the Server-side.". – thirtydot Jul 20 '18 at 18:01
  • Ya I went through it, but I need to provide whole data to grid through datasource then it performs infinite scrolling. And providing whole data at once take time, i do not want to fetch whole data at once. Any way I can achieve this? – Mangesh Tak Jul 20 '18 at 18:07
  • It doesn't "fetch [the] whole data at once". https://www.ag-grid.com/javascript-grid-infinite-scrolling/#getrows says: "The startRow and endRow define the range expected for the call. For example, if block size is 100, the getRows function will be called with `startRow: 0` and `endRow: 100` and the grid will expect a result with 100 rows (that's rows 0 to 99).". Your backend should only be returning the requested rows, not *every* row. – thirtydot Jul 20 '18 at 18:31
  • ok, so in that case I need to call API multiple times. right? – Mangesh Tak Jul 20 '18 at 18:42

0 Answers0