Level 73
@ddsameera you can add this callback function to your DataTable initialization config.
"initComplete": function (settings, json) {
let api = new $.fn.dataTable.Api(settings);
let url = new URL(window.location.href);
let page = url.searchParams.get("page");
if (page !== null) {
api.page(parseInt(page) - 1).draw(false);
}
}
So from the code above the expected param is ?page=10 and I do parseInt(page) - 1 as the pagination is 0 indexed, so if you got to page 1 it will show the first page and so on..