add js file and dummy ig for testing

This commit is contained in:
LailaWulandarii 2025-12-26 21:30:09 +07:00
parent f916c03ede
commit 0be58b2eee
6 changed files with 86 additions and 55 deletions

BIN
public/img/ava.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
public/img/hero-buket.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
public/img/hero-foto.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
public/img/invoice.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,15 @@
let dataTable = new simpleDatatables.DataTable( // Fungsi "Pabrik" untuk membuat dan mendandani tabel
document.getElementById("table1") 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 // Move "per page dropdown" selector element out of label
// to make it work with bootstrap 5. Add bs5 classes. // to make it work with bootstrap 5. Add bs5 classes.
function adaptPageDropdown() { function adaptPageDropdown() {
@ -50,3 +59,20 @@ dataTable.on("datatable.sort", refreshPagination)
// Re-patch pagination after the page was changed // Re-patch pagination after the page was changed
dataTable.on("datatable.page", adaptPagination) 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'));
});
});