df
This commit is contained in:
parent
3220513705
commit
cbabc81a9e
|
|
@ -47467,7 +47467,8 @@ function medecinsprestataire()
|
|||
*******************************************************************/
|
||||
|
||||
function chargerFichiersTable() {
|
||||
const idTable = $('#listetables').val();
|
||||
const $select = $('#listetables');
|
||||
const idTable = $select.val();
|
||||
const racineWeb = $("#racineWeb").val();
|
||||
const codeLangue = $("#codeLangue").val();
|
||||
|
||||
|
|
@ -47476,8 +47477,11 @@ function chargerFichiersTable() {
|
|||
return;
|
||||
}
|
||||
|
||||
// Feedback visuel
|
||||
const loadingHtml = `...`;
|
||||
// --- FIX ANTI-ACCUMULATION ---
|
||||
// On récupère le texte propre AVANT l'AJAX
|
||||
const selectedText = $select.find('option:selected').text().trim();
|
||||
|
||||
const loadingHtml = `<div class="text-center p-3"><div class="spinner-border spinner-border-sm text-primary"></div></div>`;
|
||||
$('#div_lister_table').html(loadingHtml);
|
||||
$('#div_maj_table').html("");
|
||||
|
||||
|
|
@ -47490,9 +47494,15 @@ function chargerFichiersTable() {
|
|||
$('#div_fichiers_table').html(data);
|
||||
afficheDonneesTableChoisie($('#fichier_lister').val());
|
||||
|
||||
// --- CORRECTION ICI ---
|
||||
// On force le SelectPicker à se rafraîchir pour ne pas perdre le design
|
||||
$('#listetables').selectpicker('refresh');
|
||||
// --- CORRECTION NEUTRAL PRO ---
|
||||
// 1. On rafraîchit le picker pour l'état interne
|
||||
$select.selectpicker('refresh');
|
||||
|
||||
// 2. On FORCE le texte du bouton à redevenir unique
|
||||
// On cible précisément la div interne de rendu de Bootstrap-Select
|
||||
$('.bootstrap-select .filter-option-inner-inner').each(function() {
|
||||
$(this).text(selectedText);
|
||||
});
|
||||
},
|
||||
error: function(xhr) {
|
||||
toastr.error((codeLangue === "en_US") ? "Error..." : "Erreur...");
|
||||
|
|
@ -48120,45 +48130,39 @@ function filtreTableReference(numeroTable) {
|
|||
const racineWeb = $("#racineWeb").val();
|
||||
const $divListe = $("#div_listetables");
|
||||
|
||||
// 1. ÉTAPE CRUCIALE : On détruit l'instance ET on vide physiquement le conteneur
|
||||
// pour supprimer les boutons et menus générés précédemment par le plugin
|
||||
// 1. On tue l'existant et on vide le BODY des menus flottants
|
||||
if ($("#listetables").length) {
|
||||
$("#listetables").selectpicker('destroy');
|
||||
}
|
||||
|
||||
// On nettoie aussi les menus détachés dans le body (si container: 'body' était utilisé)
|
||||
$('.bootstrap-select.bs-container').remove();
|
||||
|
||||
// On vide le conteneur HTML pour repartir sur une base 100% neuve
|
||||
$divListe.empty().html('<div class="spinner-border spinner-border-sm text-primary"></div>');
|
||||
$divListe.empty();
|
||||
|
||||
$.ajax({
|
||||
url: racineWeb + "Ajaxfiltretablesreference/",
|
||||
type : 'post',
|
||||
data: { numeroTable: numeroTable },
|
||||
success: function(data) {
|
||||
// 2. On injecte le nouveau <select> (sans la classe selectpicker dans le PHP)
|
||||
// 2. On injecte le HTML
|
||||
$divListe.html(data);
|
||||
|
||||
const $select = $("#listetables");
|
||||
|
||||
// 3. Initialisation "propre"
|
||||
// On s'assure que l'élément est prêt avant d'initialiser
|
||||
// 3. Initialisation forcée
|
||||
setTimeout(function() {
|
||||
$select.selectpicker({
|
||||
liveSearch: true,
|
||||
size: 10,
|
||||
container: 'body',
|
||||
width: '100%',
|
||||
style: 'btn-form-select'
|
||||
style: 'btn-form-select',
|
||||
noneSelectedText: '-- Sélectionner --'
|
||||
});
|
||||
|
||||
// Forcer la valeur à vide au début pour éviter l'accumulation visuelle
|
||||
$select.selectpicker('val', '');
|
||||
$select.selectpicker('refresh');
|
||||
|
||||
// --- LE FIX RADICAL ---
|
||||
// On force le nettoyage du texte du bouton pour supprimer les accumulations
|
||||
const initialText = $select.find('option:selected').text() || '-- Sélectionner --';
|
||||
$divListe.find('.filter-option-inner-inner').text(initialText);
|
||||
|
||||
$divListe.find('.dropdown-toggle').focus();
|
||||
}, 100);
|
||||
}, 150);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user