From 02e55181206c11b0b6abc2987c08165c9ef030c8 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Thu, 24 Apr 2025 17:40:28 +0530 Subject: [PATCH] Edit page pagination reset : GWM --- app/Views/configlisting.php | 14 +++++++++++++- app/Views/costListing.php | 14 +++++++++++++- app/Views/departmentListing.php | 15 ++++++++++++++- app/Views/editconfig.php | 16 ++++++++++++++-- app/Views/factoryMachineMasterDetails.php | 14 +++++++++++++- app/Views/supplierListing.php | 14 +++++++++++++- app/Views/transporterListing.php | 16 ++++++++++++++-- app/Views/userListing.php | 23 ++++++++++++++++++++--- 8 files changed, 114 insertions(+), 12 deletions(-) diff --git a/app/Views/configlisting.php b/app/Views/configlisting.php index 0796b75a..aec8b2ad 100755 --- a/app/Views/configlisting.php +++ b/app/Views/configlisting.php @@ -172,7 +172,7 @@ isActive == 1 ? 'Active' : 'InActive'; ?> - ; // Default to 1 if not set diff --git a/app/Views/costListing.php b/app/Views/costListing.php index a6a70462..7d49da7e 100755 --- a/app/Views/costListing.php +++ b/app/Views/costListing.php @@ -134,7 +134,7 @@     -    - \ No newline at end of file diff --git a/app/Views/factoryMachineMasterDetails.php b/app/Views/factoryMachineMasterDetails.php index a3545514..4b752a24 100644 --- a/app/Views/factoryMachineMasterDetails.php +++ b/app/Views/factoryMachineMasterDetails.php @@ -170,7 +170,7 @@ - @@ -241,6 +241,18 @@ e.preventDefault(); table.draw(); }); + + $('#datatable').on('click', '.edit-btn', function () { + const pageInfo = table.page.info(); // Now this works + sessionStorage.setItem("datatablePage", pageInfo.page); + }); + + // Restore page + let startPage = sessionStorage.getItem("datatablePage"); + if (startPage !== null) { + table.page(parseInt(startPage)).draw('page'); + sessionStorage.removeItem("datatablePage"); + } }); diff --git a/app/Views/supplierListing.php b/app/Views/supplierListing.php index 7500691f..e0df865e 100755 --- a/app/Views/supplierListing.php +++ b/app/Views/supplierListing.php @@ -155,7 +155,7 @@ -     -    + class="fa fa-edit edit-btn">       @@ -351,6 +351,18 @@ } }); + $('#transporter_list').on('click', '.edit-btn', function () { + const pageInfo = table.page.info(); // Now this works + sessionStorage.setItem("datatablePage", pageInfo.page); + }); + + // Restore page + let startPage = sessionStorage.getItem("datatablePage"); + if (startPage !== null) { + table.page(parseInt(startPage)).draw('page'); + sessionStorage.removeItem("datatablePage"); + } + // Date range filter function $.fn.dataTable.ext.search.push( function (settings, data, dataIndex) { diff --git a/app/Views/userListing.php b/app/Views/userListing.php index 1150bddd..77693d12 100755 --- a/app/Views/userListing.php +++ b/app/Views/userListing.php @@ -151,7 +151,7 @@ isDeleted == 1) { ?> - @@ -160,7 +160,7 @@ - + @@ -207,6 +207,8 @@ var answer = confirm(" Do you want to delete the user from the List?") if (answer) {return;}else{event.preventDefault();} } + + @@ -303,4 +318,6 @@ console.log("Checkbox changed, submitting form..."); $("#archiveFormId").submit(); }); - \ No newline at end of file + + +