det
This commit is contained in:
parent
3455a3104e
commit
dc8a6bdc02
|
|
@ -92276,17 +92276,17 @@ function initSmartTable(selector = '.datatable-inter', pageTitle = 'Export Donn
|
||||||
$(selector).DataTable().destroy();
|
$(selector).DataTable().destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Modification du DOM :
|
||||||
|
// On enveloppe 'f' (Filter) dans une div avec 'ms-auto' pour le pousser à droite
|
||||||
var domStructure = hasGlobalSearch
|
var domStructure = hasGlobalSearch
|
||||||
? '<"d-flex align-items-center justify-content-start p-3 border-bottom"B>t<"d-flex justify-content-between align-items-center p-3 bg-light"ip>'
|
? '<"d-flex align-items-center justify-content-start p-3 border-bottom"B>t<"d-flex justify-content-between align-items-center p-3 bg-light"ip>'
|
||||||
: '<"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>';
|
: '<"d-flex align-items-center p-3 border-bottom"B<"ms-auto"f>>t<"d-flex justify-content-between align-items-center p-3 bg-light"ip>';
|
||||||
|
|
||||||
// Détermination de l'option "order" :
|
|
||||||
// Si defaultOrder est explicitement false, on passe un tableau vide pour désactiver le tri auto
|
|
||||||
var orderConfig = (defaultOrder === false) ? [] : defaultOrder;
|
var orderConfig = (defaultOrder === false) ? [] : defaultOrder;
|
||||||
|
|
||||||
var table = $(selector).DataTable({
|
var table = $(selector).DataTable({
|
||||||
"dom": domStructure,
|
"dom": domStructure,
|
||||||
"order": orderConfig, // <--- AJOUT ICI
|
"order": orderConfig,
|
||||||
"buttons": [
|
"buttons": [
|
||||||
{
|
{
|
||||||
extend: 'excelHtml5',
|
extend: 'excelHtml5',
|
||||||
|
|
@ -92304,14 +92304,21 @@ function initSmartTable(selector = '.datatable-inter', pageTitle = 'Export Donn
|
||||||
],
|
],
|
||||||
"language": {
|
"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 : ",
|
"search": "", // On vide le texte "Rechercher :" pour un look plus moderne
|
||||||
"searchPlaceholder": "Filtrer..."
|
"searchPlaceholder": "Rechercher..."
|
||||||
},
|
},
|
||||||
"pageLength": 10,
|
"pageLength": 10,
|
||||||
"autoWidth": false,
|
"autoWidth": false,
|
||||||
"drawCallback": function() {
|
"drawCallback": function() {
|
||||||
if (!hasGlobalSearch) {
|
if (!hasGlobalSearch) {
|
||||||
$('.dataTables_filter input').addClass('form-control form-control-sm d-inline-block ms-2 rounded-pill border-2 shadow-none').css('width', '200px');
|
// Style de l'input de recherche
|
||||||
|
$('.dataTables_filter input')
|
||||||
|
.addClass('form-control form-control-sm shadow-none border-primary-subtle')
|
||||||
|
.css({
|
||||||
|
'width': '250px',
|
||||||
|
'border-radius': '20px',
|
||||||
|
'padding-left': '15px'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
$('.dataTables_paginate .paginate_button').addClass('btn btn-xs mx-1');
|
$('.dataTables_paginate .paginate_button').addClass('btn btn-xs mx-1');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user