2
votes

So I'm using ag-Grid in my React project. I'm trying to load data on the server and render them via pagination in the UI, instead of the getting the whole dataset at one go.

However, it looks like this method only works with ag-grid's infinite scroll: https://www.ag-grid.com/javascript-grid-server-side-model

Since I'm trying to avoid infinite scrolling, I'm wondering if there's a way I can bypass or override ag-grid's internal pagination with my own pagination control that will make a call out to the server for the next chunk of data on every page..?

Thanks!

1

1 Answers

0
votes

Inside the source you have brought there is a code for manipulate the one every server request here

but if that an issue of enterprise you make try to look in the infinite scroll custom solution:

You can use ag-grid API to set the dataSource

look at the example here

onGridReady(params) {
    this.api = params.api;
    this.api.setDatasource(this.props.dataSource(params));
}

<AgGridReact
  onGridReady={this.onGridReady}
/>