1

I am trying to use ag-grid-angular in an Angular-6 project. My data source in an API, where data is coming in paginated form.

I am unable to find any example where, server is getting hit on page change in ag-grid.

There is an example in infinite scroll, but it loads all data in one go and paginate a client side.

Please help.

ViqMontana
  • 5,090
  • 3
  • 19
  • 54
raju
  • 6,448
  • 24
  • 80
  • 163

1 Answers1

0

Pagination in ag-Grid is client side only. If you want to lazy load the data, then you need to use one of the row models that lazy load the data eg Infinite Scroll Row Model or Server Side Row Model (enterprise only). If you want it work that the data is coming from the server every time you go to a new page then use Infinite Row Model and make the Infinite Row Model block size the same as the pagination page size, so each time a new page is navigated to a new block is fetched. The example here on the ag-Grid website shows exactly this: https://www.ag-grid.com/javascript-grid-infinite-scrolling/#example-2-equal-pagination-page-size-and-large-infinite-block-si

Niall Crosby
  • 329
  • 1
  • 4
  • 1
    I went through that sample already, but in that example, all data is fetched in on go, while my data is coming as paginated from server. – raju Dec 03 '18 at 01:53
  • the example given in ag grid docs is unclear and gives only vague idea to anyone who comes there... – A DEv Feb 15 '22 at 10:27