From 3e173357bd5e7a107ca7b52af2b90616e7ab376b Mon Sep 17 00:00:00 2001 From: KONE SOREL Date: Sat, 7 Mar 2026 09:43:00 +0000 Subject: [PATCH] d --- Js/fonctions.js | 49 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/Js/fonctions.js b/Js/fonctions.js index 76102e17..8de9dadf 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -47666,11 +47666,15 @@ function formAjoutTableRef() { type: 'post', data: donnees, success: function(data) { + // Injection du HTML $('#div_maj_table').html(data); + + // SOLUTION RADICALE : On force la réinitialisation + forceInitSelectPicker('#div_maj_table'); - // Init composants + // Autres initialisations $(".datepicker").datepicker({ autoclose: true, format: 'dd/mm/yyyy' }); - $(".selectpicker").selectpicker('refresh'); + if (typeof stylechampsRequis === "function") stylechampsRequis(); // Focus setTimeout(() => { @@ -47683,25 +47687,18 @@ function formAjoutTableRef() { // Filtrer la liste des villes par pays function filtreVilleParPays() { const codePays = $('#codePays').val(); - const racineWeb = $("#racineWeb").val(); const $divVille = $('#div_ville'); - if (!codePays) return; - $.ajax({ - url: racineWeb + "Ajaxfiltrevilleparpays/", + url: $("#racineWeb").val() + "Ajaxfiltrevilleparpays/", type: 'post', data: { codePays: codePays }, success: function(data) { - // Étape radicale : on vide et on nettoie avant l'injection - $divVille.find('.selectpicker').selectpicker('destroy'); - $divVille.empty(); - - // Injection du nouveau HTML (qui doit contenir le présents + $container.find('select.selectpicker').each(function() { + $(this).selectpicker({ + liveSearch: true, + style: 'btn-white border-2 border-start-0 fw-bold', + width: '100%', + size: 8, + dropdownAlignRight: 'auto' + }); + + // 3. Forcer le rafraîchissement du rendu + $(this).selectpicker('refresh'); + }); } \ No newline at end of file