dfg
This commit is contained in:
parent
b551035adc
commit
3fba7ca44c
|
|
@ -47477,11 +47477,6 @@ function medecinsprestataire()
|
|||
window.location.assign($("#racineWeb").val()+"Medecinsprestataire/");
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* AUTRE TABLE DE REFERENCES
|
||||
*******************************************************************/
|
||||
|
||||
/******************************************************************
|
||||
* AUTRE TABLE DE REFERENCES
|
||||
*******************************************************************/
|
||||
|
|
@ -47496,34 +47491,41 @@ function chargerFichiersTable() {
|
|||
return;
|
||||
}
|
||||
|
||||
// --- FIX ANTI-ACCUMULATION ---
|
||||
// On récupère le texte propre AVANT l'AJAX
|
||||
// On mémorise la valeur sélectionnée AVANT de détruire le picker
|
||||
const selectedVal = $select.val();
|
||||
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>`;
|
||||
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("");
|
||||
|
||||
// ✅ ÉTAPE CLÉ : on détruit proprement le picker AVANT l'AJAX
|
||||
// Cela évite que le HTML chargé le réinitialise en double
|
||||
$select.selectpicker('destroy');
|
||||
|
||||
$.ajax({
|
||||
url: racineWeb + "Ajaxaccesfichiersautrestables/",
|
||||
type: 'post',
|
||||
data: { id: idTable },
|
||||
success: function(data) {
|
||||
fermeFormulaire();
|
||||
$('#div_fichiers_table').html(data);
|
||||
fermeFormulaire();
|
||||
$('#div_fichiers_table').html(data); // le script global dans data ne trouvera plus de picker à dupliquer
|
||||
afficheDonneesTableChoisie($('#fichier_lister').val());
|
||||
|
||||
// --- 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);
|
||||
|
||||
// ✅ On réinitialise UNE seule fois proprement
|
||||
$select.selectpicker({
|
||||
liveSearch: true
|
||||
});
|
||||
|
||||
// ✅ On restaure la valeur sélectionnée
|
||||
$select.selectpicker('val', selectedVal);
|
||||
},
|
||||
error: function(xhr) {
|
||||
// En cas d'erreur, on réinitialise quand même le picker
|
||||
$select.selectpicker({ liveSearch: true });
|
||||
$select.selectpicker('val', selectedVal);
|
||||
toastr.error((codeLangue === "en_US") ? "Error..." : "Erreur...");
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user