dfg
This commit is contained in:
@@ -91642,4 +91642,38 @@ function loadMessageSection(section) {
|
||||
$(target).html('<div class="alert alert-danger m-3">Erreur de chargement</div>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initSmartTable(selector = '.datatable-inter', pageTitle = 'Export Données') {
|
||||
if ($(selector).length === 0) return;
|
||||
|
||||
return $(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>',
|
||||
"buttons": [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
text: '<i class="fas fa-file-excel me-2"></i>Excel',
|
||||
className: 'btn btn-success btn-sm fw-bold border-0 shadow-sm px-3 me-2'
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
text: '<i class="fas fa-file-pdf me-2"></i>PDF',
|
||||
className: 'btn btn-danger btn-sm fw-bold border-0 shadow-sm px-3',
|
||||
title: pageTitle,
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
"language": {
|
||||
"url": "//cdn.datatables.net/plug-ins/1.13.6/i18n/fr-FR.json",
|
||||
"search": "",
|
||||
"searchPlaceholder": "Rechercher..."
|
||||
},
|
||||
"pageLength": 10,
|
||||
"drawCallback": function() {
|
||||
// Style dynamique de la barre de recherche
|
||||
$('.dataTables_filter input').addClass('form-control form-control-sm rounded-pill border-2 ps-3 shadow-none');
|
||||
$('.dataTables_paginate .paginate_button').addClass('btn btn-xs mx-1');
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user