From 11c231c99ce3295bf0773f61cabdbadfc2b1255d Mon Sep 17 00:00:00 2001 From: KONE SOREL Date: Thu, 5 Mar 2026 19:47:04 +0000 Subject: [PATCH] ffff --- Bootstrap_new/css/theme-modern.css | 17 +++++++++++++---- Js/fonctions.js | 28 +++++++++++++++++++--------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/Bootstrap_new/css/theme-modern.css b/Bootstrap_new/css/theme-modern.css index 6b08f36e..877262d1 100644 --- a/Bootstrap_new/css/theme-modern.css +++ b/Bootstrap_new/css/theme-modern.css @@ -1435,9 +1435,18 @@ select[class*="selectpicker"], opacity: 0.8; } -.dt-buttons-custom { - margin-right: 15px; + +/* S'assurer que le titre "Rechercher :" est aligné avec son input */ +.dataTables_filter label { + display: flex; + align-items: center; + margin-bottom: 0; + font-weight: 600; + color: var(--text-dark); } -.dt-search-custom input { - min-width: 200px; + +/* Espacement entre les boutons export */ +.dt-buttons { + display: flex; + align-items: center; } \ No newline at end of file diff --git a/Js/fonctions.js b/Js/fonctions.js index 69d9bddf..c60f403d 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -91659,32 +91659,42 @@ function loadMessageSection(section) { }); } -function initSmartTable(selector, pageTitle = 'Export') { - if (!$(selector).length) return; +function initSmartTable(selector = '.datatable-inter', pageTitle = 'Export Données') { + if ($(selector).length === 0) return; - // Destruction de l'instance si elle existe déjà (évite les erreurs Ajax) if ($.fn.DataTable.isDataTable(selector)) { $(selector).DataTable().destroy(); } return $(selector).DataTable({ - // 'B' = Buttons, 'f' = filter, 'r' = processing, 't' = table, 'i' = info, 'p' = pagination - "dom": 'Bfrtip', + // MODIFICATION : On utilise une seule ligne (div) pour les boutons et la recherche + "dom": '<"d-flex align-items-center justify-content-between p-3 border-bottom"Bf>t<"d-flex justify-content-between align-items-center p-3 bg-light"ip>', "buttons": [ { extend: 'excelHtml5', text: 'Excel', - className: 'btn btn-success btn-sm' + className: 'btn btn-success btn-sm fw-bold border-0 shadow-sm px-3' }, { extend: 'pdfHtml5', text: 'PDF', - className: 'btn btn-danger btn-sm', - title: pageTitle + className: 'btn btn-danger btn-sm fw-bold border-0 shadow-sm px-3 ms-2', // Ajout d'une marge à gauche du bouton PDF + title: pageTitle, + orientation: 'landscape', + pageSize: 'A4' } ], "language": { - "url": "//cdn.datatables.net/plug-ins/1.13.6/i18n/fr-FR.json" + "url": "//cdn.datatables.net/plug-ins/1.13.6/i18n/fr-FR.json", + "search": "Rechercher : ", + "searchPlaceholder": "Filtrer..." + }, + "pageLength": 10, + "autoWidth": false, + "drawCallback": function() { + // Style de la barre de recherche pour qu'elle ne soit pas trop collée + $('.dataTables_filter input').addClass('form-control form-control-sm d-inline-block ms-2 rounded-pill border-2 shadow-none').css('width', '200px'); + $('.dataTables_paginate .paginate_button').addClass('btn btn-xs mx-1'); } }); } \ No newline at end of file