mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-09 21:56:32 +08:00
Merge pull request #7668 from rekonder/aj_SCI_10827
Save table content after removing row or columns [SCI-10827]
This commit is contained in:
commit
a2efba009a
1 changed files with 17 additions and 6 deletions
|
|
@ -267,6 +267,16 @@ export default {
|
||||||
|
|
||||||
this.$emit('update', this.element, false, callback);
|
this.$emit('update', this.element, false, callback);
|
||||||
},
|
},
|
||||||
|
updateTableData() {
|
||||||
|
if (this.editingTable === false) return;
|
||||||
|
this.updatingTableData = true;
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.update(() => {
|
||||||
|
this.editingCell = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
loadTableData() {
|
loadTableData() {
|
||||||
const container = this.$refs.hotTable;
|
const container = this.$refs.hotTable;
|
||||||
const data = JSON.parse(this.element.attributes.orderable.contents);
|
const data = JSON.parse(this.element.attributes.orderable.contents);
|
||||||
|
|
@ -294,12 +304,13 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
afterChange: () => {
|
afterChange: () => {
|
||||||
if (this.editingTable === false) return;
|
this.updateTableData();
|
||||||
this.updatingTableData = true;
|
},
|
||||||
|
afterRemoveRow: () => {
|
||||||
this.$nextTick(() => {
|
this.updateTableData();
|
||||||
this.update(() => this.editingCell = false);
|
},
|
||||||
});
|
afterRemoveCol: () => {
|
||||||
|
this.updateTableData();
|
||||||
},
|
},
|
||||||
beforeKeyDown: (e) => {
|
beforeKeyDown: (e) => {
|
||||||
if (e.keyCode === 27) { // esc
|
if (e.keyCode === 27) { // esc
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue