diff --git a/js/admin.js b/js/admin.js index b7c1071..58e0416 100644 --- a/js/admin.js +++ b/js/admin.js @@ -112,7 +112,7 @@ async function loadDashboardData() { } catch (err) { console.error('Erreur chargement :', err); } } -// ── RENDU DU TABLEAU (SANS COLONNE AFFICHE) ── +// ── RENDU DU TABLEAU (PAGINATION CORRIGÉE) ── function renderAdminTable() { const tbody = document.getElementById('admin-table-body'); if (!tbody) return; @@ -133,18 +133,18 @@ function renderAdminTable() { const countLabel = document.getElementById('admin-count-label'); if(countLabel) countLabel.textContent = `${filtered.length} élément(s)`; - // --- PAGINATION LOGIC --- + // --- LOGIQUE DE PAGINATION --- const totalPages = Math.ceil(filtered.length / itemsPerPage) || 1; if (currentPage > totalPages) currentPage = totalPages; const startIdx = (currentPage - 1) * itemsPerPage; const pageItems = filtered.slice(startIdx, startIdx + itemsPerPage); - // ------------------------ + // ----------------------------- pageItems.forEach(f => { const tr = document.createElement('tr'); const isChecked = selectedIds.has(String(f.id)) ? 'checked' : ''; - // SEULEMENT 6 COLONNES (Plus d'affiche) + // 6 COLONNES (Plus d'affiche) tr.innerHTML = `