0

When using the server-side model for Ag-grid, how does the grid know the number of pages (i.e. how does it display Page 1 of X)...coz we only fetch like e.g. 100 records at once even if there are like 500 possible records ...(so how does the grid know that X here is 5)

Is there some specific attribute to be set (for X) when calling the AGGrid component ?

copenndthagen
  • 49,230
  • 102
  • 290
  • 442

3 Answers3

0

You could either use something like below Documentation

enter image description here

Or you can implement infinite scrolling Documentation

There is another example implemented that is explained at SO

Ag grid Server side pagination

https://github.com/renilbabu03/agGridExample

Bharat
  • 1,192
  • 7
  • 14
0

The grid property paginationPageSize is what determines how many rows will show per page.

By default paginationPageSize is set to 100.

For example in the following example: https://plnkr.co/edit/3VUNVvSNucbnsbJe

There are 8000 rows in the Server, the Grid is fetching 500 rows at a time and there are 200 rows in each page.

Shuheb
  • 2,012
  • 1
  • 4
  • 6
  • So in the example you shared, it actually says Page 1 of more and does not display the actual number of records (i.e. says Page 1 of more and not Page 1 of 8)...so that was my question as I have seen in some examples, it shows the actual number of pages (instead of 'more') – copenndthagen Jul 28 '21 at 12:07
0

Grid property "paginationPageSize" determined the number of records shown in the grid. In Serverside pagination, the API response must return the total elements("totalRows"). Based on totalRows, Grid will decide the number of pages.