From d53a8f0b1c3a063434a0457d508ddea5fff8bb0f Mon Sep 17 00:00:00 2001 From: Andrej Date: Fri, 28 Jun 2024 13:05:28 +0200 Subject: [PATCH] Save table content after removing row or columns [SCI-10827] --- app/javascript/vue/shared/content/table.vue | 23 +++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/app/javascript/vue/shared/content/table.vue b/app/javascript/vue/shared/content/table.vue index d0144da2d..d0825b6f1 100644 --- a/app/javascript/vue/shared/content/table.vue +++ b/app/javascript/vue/shared/content/table.vue @@ -267,6 +267,16 @@ export default { this.$emit('update', this.element, false, callback); }, + updateTableData() { + if (this.editingTable === false) return; + this.updatingTableData = true; + + this.$nextTick(() => { + this.update(() => { + this.editingCell = false; + }); + }); + }, loadTableData() { const container = this.$refs.hotTable; const data = JSON.parse(this.element.attributes.orderable.contents); @@ -294,12 +304,13 @@ export default { } }, afterChange: () => { - if (this.editingTable === false) return; - this.updatingTableData = true; - - this.$nextTick(() => { - this.update(() => this.editingCell = false); - }); + this.updateTableData(); + }, + afterRemoveRow: () => { + this.updateTableData(); + }, + afterRemoveCol: () => { + this.updateTableData(); }, beforeKeyDown: (e) => { if (e.keyCode === 27) { // esc