Fix handson table metadata issue [SCI-8138]

This commit is contained in:
Anton 2023-03-16 12:02:20 +01:00
parent f94c9e0b36
commit 5a242021e3
2 changed files with 26 additions and 14 deletions

View file

@ -39,13 +39,19 @@
var metadata = $('.hot-metadata');
var data = JSON.stringify({data: hot.getData()});
contents.attr('value', data);
metadata.attr('value', JSON.stringify({cells: hot.getCellsMeta().map((x) => {
return {
col: x.col,
row: x.row,
className: x.className || ''
}
})}))
metadata.attr('value', JSON.stringify({cells: hot.getCellsMeta().map(
(x) => {
if (x) {
return {
col: x.col,
row: x.row,
className: x.className || ''
}
} else {
return null
}
}).filter(e => { return e !== null})
}))
return true;
});
}

View file

@ -158,13 +158,19 @@
let tableData = JSON.stringify({data: this.tableObject.getData()});
this.element.attributes.orderable.contents = tableData;
this.element.attributes.orderable.metadata = {cells: this.tableObject.getCellsMeta().map((x) => {
return {
col: x.col,
row: x.row,
className: x.className || ''
}
})};
this.element.attributes.orderable.metadata = {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})
};
this.update();
this.editingTable = false;
},