1
votes

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.

1
Possible duplicate - ViqMontana

1 Answers

0
votes

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