mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-17 14:46:00 +08:00
18 lines
491 B
JavaScript
18 lines
491 B
JavaScript
|
/* global Handsontable */
|
||
|
window.onload = function() {
|
||
|
var tables = document.getElementsByClassName('hot-table-container');
|
||
|
var tableVals = document.getElementsByClassName('hot-table-contents');
|
||
|
|
||
|
for (let i = 0; i < tables.length; i += 1) {
|
||
|
tables[i].innerHTML = '';
|
||
|
new Handsontable(tables[i], {
|
||
|
data: JSON.parse(tableVals[i].value).data,
|
||
|
rowHeaders: true,
|
||
|
colHeaders: true,
|
||
|
filters: true,
|
||
|
dropdownMenu: true,
|
||
|
formulas: true
|
||
|
});
|
||
|
}
|
||
|
};
|