I'm using ag-grid with server-side row model and pagination, just the previous and next buttons, no scrolling. I want ag-grid to load data (so calling getRows()) on every click to next and previous.
It works fine for next page but the data for previous page is never loaded again from server.
I'm using this config properties for pagination and cache:
rowModelType: 'serverSide',
pagination: true,
paginationPageSize: 10,
cacheBlockSize: 10,
maxBlocksInCache: 0
More or less completely disabling cache on client side. Any hint how to accomplish that?
Here is your solution:
maxBlocksInCache = 1;
cacheBlockSize - should be the same as paginationPageSize (cuz it would one visible 'scope' - for block storage, so remember to bind it to one property) and then - block storage is a maxBlocksInCache - should be the one only (cuz one visible block is equal to one block in cache)
rowModelType: 'serverSide',
pagination: true,
paginationPageSize: 10,
cacheBlockSize: 10,
maxBlocksInCache: 1
Demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With