If you find compatibility problems using the .draw(false);
, maybe it will be necessary to use a script to iterate the page elements, store the paging, change what you need, draw() the table and then click on each page link. One way could be something like this (using jquery):
//storing the dataTable paging
async function storePaging (){
let lnks=[];
await $('.paginate_button').each(function(i, obj){
//iterates the '.paginate_button' elements (responsible for paging)
classe = $(this).attr("class");
ariaControls = $(this).attr("aria-controls");
dataDtIdx = $(this).attr("data-dt-idx");
//use the indexOf only if you have lots of dataTables into your page and want to specify some of it
if (classe == "paginate_button current" && ariaControls.indexOf("tableId") > -1){
lnks.push({classe:classe, ariaControls:ariaControls, dataDtIdx:dataDtIdx})
}
});
return lnks;
}
//iterates (each) on paging elements and click
async function clickTablesPaging(lnks){
await $('.paginate_button').each(function(i, obj){
//separates each value
classe = $(this).attr("class");
ariaControls = $(this).attr("aria-controls");
dataDtIdx = $(this).attr("data-dt-idx");
//iterates stored paging and click
for (let elm of lnks){
if ((classe == "paginate_button current" || classe==("paginate_button ")) && ariaControls == elm.ariaControls && Number(dataDtIdx)==elm.dataDtIdx){
$(this).click();
}
}
});
}
To use those functions you need just call them on the sequence bellow:
let pgs = await storePaging();
//draw the dataTable
await table.draw();
clickTablesPaging(pgs);