latest commit 17-05-2025

This commit is contained in:
vadivelJ96 2025-05-17 18:01:55 +05:30
parent e0dfc974f9
commit d8db318617

View File

@ -191,7 +191,7 @@
<?php } ?>
<?php } ?>
<button title="Edit" class="edit-button" data-toggle="modal" data-target="#expenseModal" data-id="<?php echo $record['id']; ?>" style="border: none;background-color: white;color: #02a8b5;">
<button title="Edit" class="edit-button edit-btn" data-toggle="modal" data-target="#expenseModal" data-id="<?php echo $record['id']; ?>" style="border: none;background-color: white;color: #02a8b5;">
<i class="fas fa-pencil-alt"></i>
</button>
</td>
@ -645,4 +645,32 @@ dateInput.addEventListener('change', function () {
});
});
</script>
</script>
<script>
$(document).ready(function () {
// Ensure DataTable is initialized
let table = $('#expense_list_table').DataTable();
console.log("DataTable initialized:", table ? "Yes" : "No");
// Store page number on edit button click
$('#expense_list_table').on('click', '.edit-btn', function () {
const pageInfo = table.page.info();
console.log("Edit clicked, current page info:", pageInfo);
sessionStorage.setItem("datatablePage", pageInfo.page);
});
// Restore page if saved
let startPage = sessionStorage.getItem("datatablePage");
if (startPage !== null) {
console.log("Restoring to page:", startPage);
table.page(parseInt(startPage)).draw('page');
sessionStorage.removeItem("datatablePage");
} else {
console.log("No page info found in sessionStorage.");
}
});
</script>