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() {
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()