regarding pagination in tables , when i am on the page 6 in table and delete any item in that case the page is redirected to first page after deleting the item
i am using this url: https://preview.keenthemes.com/metronic8/angular/demo1/crafted/pages/wizards/vertical
Hi
Glad to hear the solution is working well for you.
Hi
the pagination reset issue is related to how DataTables handles reloading after deletion. The problem is in how the table is refreshed after a delete operation.
The fix needs to be implemented in the component that handles the delete operation and table reload.
The reload handler calls dtInstance.ajax.reload() without parameters.
// CURRENT CODE (resets pagination):
this.datatableElement.dtInstance.then((dtInstance: DataTables.Api) => dtInstance.ajax.reload());
// CHANGE TO (preserves pagination):
this.datatableElement.dtInstance.then((dtInstance: DataTables.Api) => dtInstance.ajax.reload(null, false));
if (this.reload) {
this.reload.subscribe(data => {
this.modalService.dismissAll();
this.datatableElement.dtInstance.then((dtInstance: DataTables.Api) => dtInstance.ajax.reload(null, false));
});
}
Thanks It's working well
Hi Ravi Kakadiya
The link you provided is the demo page for wizard form component. Are you working on datatable?
Thanks
Yes, I am working on datatables.
as of now, i have completed 3 projects using Metronic, and this issue is arising in all the projects