mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-11 07:34:41 +08:00
Cache the values of formulas of HOT tables in meta data [SCI-8173] (#5406)
This commit is contained in:
parent
fc6f443b1e
commit
19cad569b3
1 changed files with 17 additions and 12 deletions
|
@ -162,18 +162,23 @@
|
|||
update() {
|
||||
this.element.attributes.orderable.contents = JSON.stringify({ data: this.tableObject.getData() });
|
||||
this.element.attributes.orderable.metadata = JSON.stringify({
|
||||
cells: this.tableObject.getCellsMeta().map(
|
||||
(x) => {
|
||||
if (x) {
|
||||
return {
|
||||
col: x.col,
|
||||
row: x.row,
|
||||
className: x.className || ''
|
||||
}
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}).filter(e => { return e !== null })
|
||||
cells: this.tableObject
|
||||
.getCellsMeta()
|
||||
.filter(e => !!e)
|
||||
.map((x) => {
|
||||
const {row, col} = x;
|
||||
const plugins = this.tableObject.plugin;
|
||||
const cellId = plugins.utils.translateCellCoords({row, col});
|
||||
const calculated = plugins.matrix.getItem(cellId)?.value ||
|
||||
this.tableObject.getDataAtCell(row, col) ||
|
||||
null;
|
||||
return {
|
||||
row: row,
|
||||
col: col,
|
||||
className: x.className || '',
|
||||
calculated: calculated
|
||||
}
|
||||
})
|
||||
});
|
||||
this.$emit('update', this.element)
|
||||
this.ajax_update_url()
|
||||
|
|
Loading…
Add table
Reference in a new issue