Any ideas for Pagination dynamic loading usage

Because of large dataset, I’m trying to use dynamic loading, but stuck here (https://forum.dhtmlx.com/t/lazydataproxy-how-to-pass-extra-args-to-url/78910).
So I’m also trying dhx.pagination for releasing the load pressure.

However, I cannot find a solution to preset the total_count for the pagination, so that all the page buttons can show on the page.
I’m not sure whether my idea is reasonable. Could you please provide some ideas ?
Thx

Here is a snippet with the Grid pagination + lazy loading:
https://snippet.dhtmlx.com/6ugrrpu4
and also here is another one snippet demonstrating the dynamic page size update:
https://snippet.dhtmlx.com/ydltr1it