Cache the values of formulas of HOT tables in meta data [SCI-8173] (#5406)

This commit is contained in:
Soufiane 2023-05-16 11:19:56 +02:00 committed by GitHub
parent fc6f443b1e
commit 19cad569b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -162,18 +162,23 @@
update() { update() {
this.element.attributes.orderable.contents = JSON.stringify({ data: this.tableObject.getData() }); this.element.attributes.orderable.contents = JSON.stringify({ data: this.tableObject.getData() });
this.element.attributes.orderable.metadata = JSON.stringify({ this.element.attributes.orderable.metadata = JSON.stringify({
cells: this.tableObject.getCellsMeta().map( cells: this.tableObject
(x) => { .getCellsMeta()
if (x) { .filter(e => !!e)
return { .map((x) => {
col: x.col, const {row, col} = x;
row: x.row, const plugins = this.tableObject.plugin;
className: x.className || '' const cellId = plugins.utils.translateCellCoords({row, col});
} const calculated = plugins.matrix.getItem(cellId)?.value ||
} else { this.tableObject.getDataAtCell(row, col) ||
return null null;
} return {
}).filter(e => { return e !== null }) row: row,
col: col,
className: x.className || '',
calculated: calculated
}
})
}); });
this.$emit('update', this.element) this.$emit('update', this.element)
this.ajax_update_url() this.ajax_update_url()