mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Fix handson table metadata issue [SCI-8138]
This commit is contained in:
parent
f94c9e0b36
commit
5a242021e3
2 changed files with 26 additions and 14 deletions
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue