Pagination is different & infinite block size is different, what you need to change count of later one. For that there's grid property cacheBlockSize. (it's I think not a part of GridOptions Interface, so bind it separately)
Example template code:
<ag-grid-angular
#agGrid
style="width: 100%; height: 100%;"
id="myGrid"
[rowData]="rowData"
class="ag-theme-balham"
[columnDefs]="columnDefs"
[components]="components"
[enableColResize]="true"
[rowBuffer]="rowBuffer"
[rowSelection]="rowSelection"
[rowDeselection]="true"
[rowModelType]="rowModelType"
[paginationPageSize]="paginationPageSize"
[cacheOverflowSize]="cacheOverflowSize"
[maxConcurrentDatasourceRequests]="maxConcurrentDatasourceRequests"
[infiniteInitialRowCount]="infiniteInitialRowCount"
[maxBlocksInCache]="maxBlocksInCache"
[cacheBlockSize] = "cacheBlockSize"
(gridReady)="onGridReady($event)"
></ag-grid-angular>
Where you can set the values in constructor:
this.rowBuffer = 0;
this.rowSelection = "multiple";
this.rowModelType = "infinite";
this.paginationPageSize = 30;
this.cacheOverflowSize = 2;
this.maxConcurrentDatasourceRequests = 1;
this.infiniteInitialRowCount = 1000;
this.maxBlocksInCache = 10;
this.cacheBlockSize = 30;
And the onGridReady method can be like:
onGridReady(params) {
this.gridApi = params.api;
this.gridColumnApi = params.columnApi;
this.http
.get("https://raw.githubusercontent.com/ag-grid/ag-grid/master/packages/ag-grid-docs/src/olympicWinners.json")
.subscribe(data => {
var dataSource = {
rowCount: null,
getRows: function(params) {
console.log("asking for " + params.startRow + " to " + params.endRow);
setTimeout(function() {
var rowsThisPage = data.slice(params.startRow, params.endRow);
var lastRow = -1;
if (data.length <= params.endRow) {
lastRow = data.length;
}
params.successCallback(rowsThisPage, lastRow);
}, 500);
}
};
params.api.setDatasource(dataSource);
});
}
Working Example , Follow Official Docs