Using infinite row model, with sorting and filtering.
As per the documentation, I have handled both sorting and filtering from server-side. Datasource is called every-time i change sort/filter model. But I cannot pre-set the filter model for when its first loaded into the grid. The can't send the initial filter model to the server.
const dataSource = {
rowCount: null,
getRows: params => {
const sortedFilteredData = requestRows(data, params.sortModel, params.filterModel);
const rowsThisPage = dataAfterSortingAndFiltering.slice(params.startRow, params.endRow);
const lastRow = -1;
if (dataAfterSortingAndFiltering.length <= params.endRow) {
lastRow = dataAfterSortingAndFiltering.length;
}
params.successCallback(rowsThisPage, lastRow);
}
};
When the datasource is first called the filterOptions is {}.
I have tried setting the model at onGridReady() using api.setFilterModel() but it throws error that we can use setFilterModel with infinite row model type.