fix(bank-data): perbaiki logika koordinat dan pembaruan pagination
- Memperbaiki pemanggilan koordinat dengan menggunakan variabel lokal. - Menambahkan fungsi untuk memperbarui informasi pagination pada tampilan. - Memastikan halaman saat ini tidak melebihi jumlah halaman yang tersedia.
This commit is contained in:
@@ -492,6 +492,7 @@
|
||||
dataTable.on('draw', () => {
|
||||
const data = dataTable._data;
|
||||
updateMapMarkers(data);
|
||||
updatePagination(data);
|
||||
})
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
@@ -515,6 +516,20 @@
|
||||
dataTable.reload();
|
||||
});
|
||||
|
||||
function updatePagination(response) {
|
||||
const paginationInfo = document.querySelector('[data-datatable-info="true"]');
|
||||
|
||||
if (paginationInfo) {
|
||||
if (response.recordsFiltered > 0) {
|
||||
const start = (response.page - 1) * response.pageSize + 1;
|
||||
const end = Math.min(start + response.pageSize - 1, response.recordsFiltered);
|
||||
paginationInfo.textContent = `Showing ${start} to ${end} of ${response.recordsFiltered} entries`;
|
||||
} else {
|
||||
paginationInfo.textContent = 'No entries to show';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initializeEverything() {
|
||||
initMap();
|
||||
initializeDataTable();
|
||||
|
||||
Reference in New Issue
Block a user