df
This commit is contained in:
@@ -92203,4 +92203,44 @@ function initSmartTable(selector = '.datatable-inter', pageTitle = 'Export Donn
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
|
||||
function loadMessageSection(section) {
|
||||
let url = "";
|
||||
let target = "#content-" + section;
|
||||
let donnees = "";
|
||||
|
||||
// Détermination de l'ID du tableau et du titre pour l'export
|
||||
let tableId = (section === 'Motifs') ? '#tableMotifs' : '#tableTextes';
|
||||
let pageTitle = (section === 'Motifs') ? 'Liste des Motifs de Dépassement' : 'Liste des Textes de Facturation';
|
||||
|
||||
if (section === 'Motifs') url = $("#racineWeb").val() + "Ajaxmotifdepassement/";
|
||||
if (section === 'Facturation') url = $("#racineWeb").val() + "Ajaxtextefacturationgarant/";
|
||||
|
||||
// Si déjà chargé, on ajuste simplement les colonnes pour le rendu visuel
|
||||
if ($(target).find('table').length > 0) {
|
||||
if ($.fn.DataTable.isDataTable(tableId)) {
|
||||
$(tableId).DataTable().columns.adjust();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'post',
|
||||
data: donnees,
|
||||
success: function(data) {
|
||||
// 1. Injection du contenu HTML
|
||||
$(target).html(data);
|
||||
|
||||
// 2. Initialisation forcée avec un léger délai pour laisser le DOM respirer
|
||||
setTimeout(function() {
|
||||
initSmartTable(tableId, pageTitle, false);
|
||||
}, 150);
|
||||
},
|
||||
error: function() {
|
||||
$(target).html('<div class="alert alert-danger m-3">Erreur de chargement</div>');
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user