feat: si data-id est négatif, cela supprime la ligne (dans le cas d'une action url_action)
This commit is contained in:
parent
2d810faf27
commit
3b4ca5a672
2 changed files with 108 additions and 85 deletions
|
@ -302,6 +302,8 @@ let nameLocalStorage = calculer_nameLocalStorage();
|
|||
|
||||
let filtreColValeurs = [];
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
localforage.setDriver(localforage[props.stockage.toUpperCase()]);
|
||||
chargerJson("maj");
|
||||
|
@ -443,6 +445,7 @@ const tableau = computed(() => {
|
|||
});
|
||||
return pagination(ttt);
|
||||
});
|
||||
|
||||
function saveTriCol() { }
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// les watchers
|
||||
|
@ -988,5 +991,16 @@ function rechargerJson(id, ajax_Crayons = true) {
|
|||
ajaxCrayons = ajax_Crayons;
|
||||
chargerJson(id);
|
||||
}
|
||||
defineExpose({ rechargerJson });
|
||||
|
||||
function delLigne(id) {
|
||||
if (id < 0) {
|
||||
id = id * -1;
|
||||
}
|
||||
console.log("delLigne : ", id);
|
||||
let i = trouver_index(table.value, id);
|
||||
if (i !== -1) {
|
||||
table.value.splice(i, 1);
|
||||
}
|
||||
}
|
||||
defineExpose({ rechargerJson, delLigne });
|
||||
</script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import 'vite/modulepreload-polyfill';
|
||||
|
||||
// Vue
|
||||
import {createApp} from 'vue';
|
||||
import { createApp } from 'vue';
|
||||
|
||||
// if importing all is too much you can always do it manually
|
||||
import GamuTable from './components/gamuTable.vue';
|
||||
|
@ -21,6 +21,7 @@ function gamutable() {
|
|||
components,
|
||||
mounted() {
|
||||
app.rechargerJson = this.$refs.montableau.rechargerJson;
|
||||
app.delLigne = this.$refs.montableau.delLigne;
|
||||
},
|
||||
});
|
||||
app.use(VuePapaParse);
|
||||
|
@ -31,6 +32,7 @@ function gamutable() {
|
|||
components,
|
||||
mounted() {
|
||||
app_deux.rechargerJson = this.$refs.montableau_deux.rechargerJson;
|
||||
app_deux.delLigne = this.$refs.montableau_deux.delLigne;
|
||||
},
|
||||
});
|
||||
app_deux.use(VuePapaParse);
|
||||
|
@ -88,6 +90,13 @@ $('#vueGamutable').on('click', '.url_action, .url_action--ss_css', function (e)
|
|||
if (Treload2) {
|
||||
app_deux.rechargerJson(id);
|
||||
}
|
||||
} else if (parseInt(id) < 0) {
|
||||
if (Treload1) {
|
||||
app.delLigne(id);
|
||||
}
|
||||
if (Treload2) {
|
||||
app_deux.delLigne(id);
|
||||
}
|
||||
} else {
|
||||
if (Treload1) {
|
||||
app.rechargerJson('maj 1');
|
||||
|
@ -98,8 +107,8 @@ $('#vueGamutable').on('click', '.url_action, .url_action--ss_css', function (e)
|
|||
}
|
||||
if (nomBlocAjaxReload !== undefined) {
|
||||
ajaxReload(nomBlocAjaxReload, {
|
||||
args: {id},
|
||||
callback: function () {},
|
||||
args: { id },
|
||||
callback: function () { },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue