fg
This commit is contained in:
parent
f739231112
commit
8f6b372d71
|
|
@ -47516,7 +47516,6 @@ function afficheDonneesTableChoisie(fichier) {
|
||||||
const $divLister = $('#div_lister_table');
|
const $divLister = $('#div_lister_table');
|
||||||
|
|
||||||
// 1. On mémorise les valeurs actuelles avant le refresh
|
// 1. On mémorise les valeurs actuelles avant le refresh
|
||||||
const paysSelectionne = $('#codePays').val();
|
|
||||||
const anneeSelectionnee = $('#annee').val();
|
const anneeSelectionnee = $('#annee').val();
|
||||||
|
|
||||||
// 2. Appel AJAX
|
// 2. Appel AJAX
|
||||||
|
|
@ -47524,26 +47523,13 @@ function afficheDonneesTableChoisie(fichier) {
|
||||||
url: racineWeb + fichier + "/",
|
url: racineWeb + fichier + "/",
|
||||||
type: 'post',
|
type: 'post',
|
||||||
data: {
|
data: {
|
||||||
codePays: paysSelectionne,
|
|
||||||
annee: anneeSelectionnee
|
annee: anneeSelectionnee
|
||||||
},
|
},
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
// 3. On remplace tout le bloc
|
// 3. On remplace tout le bloc
|
||||||
$divLister.html(data);
|
$divLister.html(data);
|
||||||
|
|
||||||
// 4. RÉ-INITIALISATION DU SELECT (Indispensable pour le look Neutral Pro)
|
// 4. INITIALISATION DATATABLE
|
||||||
// On utilise le sélecteur standard de bootstrap-select
|
|
||||||
if ($('#codePays').length > 0) {
|
|
||||||
// On détruit l'ancien qui vient d'être injecté "mort" et on le recrée
|
|
||||||
$('#codePays').selectpicker('destroy');
|
|
||||||
actualiserSelectPicker('#codePays', false);
|
|
||||||
|
|
||||||
// On lui redonne sa valeur et on rafraîchit l'affichage
|
|
||||||
$('#codePays').val(paysSelectionne).selectpicker('refresh');
|
|
||||||
$('#annee').val(anneeSelectionnee);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 5. INITIALISATION DATATABLE
|
|
||||||
// On s'assure que l'ancien ID n'existe plus en mémoire
|
// On s'assure que l'ancien ID n'existe plus en mémoire
|
||||||
if ($.fn.DataTable.isDataTable('#tableLister')) {
|
if ($.fn.DataTable.isDataTable('#tableLister')) {
|
||||||
$('#tableLister').DataTable().destroy();
|
$('#tableLister').DataTable().destroy();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user