This commit is contained in:
KONE SOREL 2026-01-19 17:40:18 +00:00
parent 392f951ec6
commit fa7987943a
2 changed files with 3 additions and 73 deletions

View File

@ -41,7 +41,7 @@ function connexion_cookie()
$(function() {
// Initialisation des composants au chargement de la page
appliquerDataTable('.tabliste');
dataTableSpecialeMini();
dataTableSpeciale();
//const vueOuverte = $("#vue").val();
let nomForm = $("#nomForm").val();
@ -1519,76 +1519,6 @@ function enregistrer_avenant()
}
function dataTableSpeciale() {
const $table = $('.tabspeciale');
const codeLangue = $("#codeLangue").val() || "fr_FR";
// Détruire l'instance existante si elle existe
if ($.fn.DataTable.isDataTable($table)) {
$table.DataTable().clear().destroy();
$table.empty(); // Optionnel : vider le contenu si nécessaire
}
// Définition des traductions
const langOptions = {
en_US: {
lengthMenu: "Display _MENU_ records per page",
zeroRecords: "Nothing found - sorry",
info: "Showing page _PAGE_ of _PAGES_",
infoEmpty: "No records available",
search: "Search:",
paginate: {
next: "►",
previous: "◄",
first: "|◄",
last: "►|"
},
infoFiltered: "(filtered from _MAX_ total records)"
},
fr_FR: {
lengthMenu: "Affiche _MENU_ par page",
zeroRecords: "Désolé - Aucune donnée trouvée",
info: "_PAGE_ sur _PAGES_ pages",
infoEmpty: "Pas d'enregistrement",
search: "Recherche:",
paginate: {
next: "►",
previous: "◄",
first: "|◄",
last: "►|"
},
infoFiltered: "(filtré de _MAX_ total enregistrements)"
}
};
// Définition des lengthMenu selon la langue
const lengthMenuOptions = (codeLangue === "en_US") ? [20, 50, 100] : [20, 50, 100];
try {
$table.DataTable({
destroy: true,
responsive: true,
lengthMenu: lengthMenuOptions,
scrollX: true,
scrollY: "75vh",
pagingType: "full_numbers",
autoWidth: false,
searching: false, // équivalent moderne de bFilter:false
ordering: false,
lengthChange: false, // équivalent moderne de bLengthChange:false
orderMulti: true,
language: langOptions[codeLangue] || langOptions.fr_FR
});
// Ajuster les colonnes après init
$table.DataTable().columns.adjust().draw();
} catch (err) {
console.error("Erreur DataTable:", err);
return false;
}
}
function pop_afficher_selection_retrait() {
var div_selection_assure = $('#div_selection_assure');
@ -1621,7 +1551,7 @@ function pop_afficher_selection_retrait() {
div_selection_assure.html(data);
// 3. INITIALISATION DU DATATABLE GÉNÉRIQUE
dataTableSpecialeMini();
dataTableSpeciale();
},
complete: function() {
// 4. Gestion propre du Modal

View File

@ -654,7 +654,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Application Scripts -->
<script src="/Js/fonctions.js?ver=2026.01.19.17"></script>
<script src="/Js/fonctions.js?ver=2026.01.19.18"></script>
<script type="text/javascript">
raffraichier_gabarit();