dfg
This commit is contained in:
parent
b551035adc
commit
3fba7ca44c
|
|
@ -47477,11 +47477,6 @@ function medecinsprestataire()
|
||||||
window.location.assign($("#racineWeb").val()+"Medecinsprestataire/");
|
window.location.assign($("#racineWeb").val()+"Medecinsprestataire/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************
|
|
||||||
* AUTRE TABLE DE REFERENCES
|
|
||||||
*******************************************************************/
|
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* AUTRE TABLE DE REFERENCES
|
* AUTRE TABLE DE REFERENCES
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
|
|
@ -47496,34 +47491,41 @@ function chargerFichiersTable() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- FIX ANTI-ACCUMULATION ---
|
// On mémorise la valeur sélectionnée AVANT de détruire le picker
|
||||||
// On récupère le texte propre AVANT l'AJAX
|
const selectedVal = $select.val();
|
||||||
const selectedText = $select.find('option:selected').text().trim();
|
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_lister_table').html(loadingHtml);
|
||||||
$('#div_maj_table').html("");
|
$('#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({
|
$.ajax({
|
||||||
url: racineWeb + "Ajaxaccesfichiersautrestables/",
|
url: racineWeb + "Ajaxaccesfichiersautrestables/",
|
||||||
type: 'post',
|
type: 'post',
|
||||||
data: { id: idTable },
|
data: { id: idTable },
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
fermeFormulaire();
|
fermeFormulaire();
|
||||||
$('#div_fichiers_table').html(data);
|
$('#div_fichiers_table').html(data); // le script global dans data ne trouvera plus de picker à dupliquer
|
||||||
afficheDonneesTableChoisie($('#fichier_lister').val());
|
afficheDonneesTableChoisie($('#fichier_lister').val());
|
||||||
|
|
||||||
// --- CORRECTION NEUTRAL PRO ---
|
// ✅ On réinitialise UNE seule fois proprement
|
||||||
// 1. On rafraîchit le picker pour l'état interne
|
$select.selectpicker({
|
||||||
$select.selectpicker('refresh');
|
liveSearch: true
|
||||||
|
|
||||||
// 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 restaure la valeur sélectionnée
|
||||||
|
$select.selectpicker('val', selectedVal);
|
||||||
},
|
},
|
||||||
error: function(xhr) {
|
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...");
|
toastr.error((codeLangue === "en_US") ? "Error..." : "Erreur...");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user