diff --git a/src/components/gamuTable.vue b/src/components/gamuTable.vue index e1fa8a5..9ed2610 100644 --- a/src/components/gamuTable.vue +++ b/src/components/gamuTable.vue @@ -764,9 +764,17 @@ function chargerJson(id) { ); let Tfiltres = []; if (props.filtreselect) { - Tfiltres = recupJson( - decodeURIComponent(props.filtreselect) - ); + props.filtreselect.split(",").forEach((unFiltre) => { + const [champ, ...valeurs] = unFiltre.split("|"); + const index = Tfiltres.findIndex( + (col) => col.champ === champ + ); + if (index === -1) { + Tfiltres.push({ champ, valeurs }); + } else { + Tfiltres[index].valeurs.push(valeurs[0]); + } + }); localStorage.setItem( "filtreselect_" + nameLocalStorage, JSON.stringify(Tfiltres) @@ -895,7 +903,7 @@ function resetTri() { Object.keys(filtreColType.value).forEach((col) => { filtreColSelected.value[col] = []; }); - saveHeader(); + localStorage.removeItem("filtreselect_" + nameLocalStorage); } function selectLigne(id, col) { if (col === "id" && parseInt(id)) {