diff --git a/Js/fonctions.js b/Js/fonctions.js index 025ce17c..8911e0e9 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -91660,35 +91660,32 @@ function loadMessageSection(section) { } -function initSmartTable(selector, pageTitle) { - if ($(selector).length === 0) return; +function initSmartTable(selector, pageTitle = 'Export') { + if (!$(selector).length) return; - // Destruction de l'instance existante pour éviter les conflits Ajax + // Destruction de l'instance si elle existe déjà (évite les erreurs Ajax) if ($.fn.DataTable.isDataTable(selector)) { $(selector).DataTable().destroy(); } - $(selector).DataTable({ - "dom": '<"d-flex justify-content-between align-items-center p-3 border-bottom"<"dt-buttons-custom"B><"dt-search-custom"f>>t<"d-flex justify-content-between align-items-center p-3 bg-light"ip>', + return $(selector).DataTable({ + // 'B' = Buttons, 'f' = filter, 'r' = processing, 't' = table, 'i' = info, 'p' = pagination + "dom": 'Bfrtip', "buttons": [ { extend: 'excelHtml5', text: 'Excel', - className: 'btn btn-success btn-sm fw-bold border-0 shadow-sm px-3 me-2' + className: 'btn btn-success btn-sm' }, { extend: 'pdfHtml5', text: 'PDF', - className: 'btn btn-danger btn-sm fw-bold border-0 shadow-sm px-3', + className: 'btn btn-danger btn-sm', title: pageTitle } ], "language": { - "url": "//cdn.datatables.net/plug-ins/1.13.6/i18n/fr-FR.json", - "search": "", - "searchPlaceholder": "Rechercher..." - }, - "responsive": true, - "autoWidth": false + "url": "//cdn.datatables.net/plug-ins/1.13.6/i18n/fr-FR.json" + } }); } \ No newline at end of file diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 72c8b517..af586736 100755 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -69,7 +69,6 @@ $descriptionVue = $_SESSION['descriptionVue']; -