add js file and dummy ig for testing
This commit is contained in:
parent
f916c03ede
commit
0be58b2eee
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 88 KiB |
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,15 @@
|
|||
let dataTable = new simpleDatatables.DataTable(
|
||||
document.getElementById("table1")
|
||||
)
|
||||
// Fungsi "Pabrik" untuk membuat dan mendandani tabel
|
||||
function initCustomTable(tableId) {
|
||||
let tableElement = document.getElementById(tableId);
|
||||
|
||||
// Cek dulu, kalau elemen tabelnya gak ada di HTML, stop (biar ga error)
|
||||
if (!tableElement) return;
|
||||
|
||||
// 1. Inisialisasi DataTable pada elemen tersebut
|
||||
let dataTable = new simpleDatatables.DataTable(tableElement);
|
||||
|
||||
// --- MULAI BAGIAN STYLING BAWAAN KAMU (Moved inside function) ---
|
||||
|
||||
// Move "per page dropdown" selector element out of label
|
||||
// to make it work with bootstrap 5. Add bs5 classes.
|
||||
function adaptPageDropdown() {
|
||||
|
|
@ -50,3 +59,20 @@ dataTable.on("datatable.sort", refreshPagination)
|
|||
|
||||
// Re-patch pagination after the page was changed
|
||||
dataTable.on("datatable.page", adaptPagination)
|
||||
|
||||
// --- SELESAI BAGIAN STYLING ---
|
||||
}
|
||||
|
||||
// 2. PANGGIL FUNGSI UNTUK KEDUA TABEL KAMU
|
||||
// Sesuaikan string ini dengan ID di HTML "FIX" kamu
|
||||
initCustomTable("riwayat-buket");
|
||||
initCustomTable("riwayat-foto");
|
||||
initCustomTable("table1");
|
||||
|
||||
|
||||
// 3. FIX TAMBAHAN (Wajib ada biar tabel di Tab ke-2 tidak gepeng)
|
||||
document.querySelectorAll('a[data-bs-toggle="pill"]').forEach(function (triggerEl) {
|
||||
triggerEl.addEventListener('shown.bs.tab', function (event) {
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue