scinote-web/app/assets/javascripts/team_zip_exports/load_handson.js
Soufiane 1b34de37ef
CSP and inline js refactor [SCI-8118][SCI-8119] (#5206)
CSP and inline js refactor [SCI-8118][SCI-8119]
2023-05-03 11:31:17 +02:00

17 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
});
}
};