I try to build an app with by ajax laoded data:
const hot = new Handsontable(document.getElementById(settings.Elem), {
nestedRows: true,
contextMenu: true,
colHeaders: ['Erstell-Datum', 'Import-Datum', 'VKNR', 'FileIdent', 'Fehler', 'Zeile', 'Spalte', 'Ist-Wert', 'Soll-Wert', 'Fehlertext'],
licenseKey: 'non-commercial-and-evaluation',
preventOverflow: 'horizontal',
rowHeaders: true,
});
The data are coming by:
$.ajax({
url: settings.DataUrl,
dataType: 'json',
success: foo => {
let bar = [];
foo.forEach(d => {
let children = [];
d.errors.forEach(e => {
children.push({
row: e.row,
col: e.col,
expectVal: e.expectVal,
storedVal: e.storedVal,
text: e.text,
});
});
bar.push({
createDate: d.createDate,
importDate: d.importDate,
vknr: d.vknr,
fileIdent: d.fileIdent,
fehleranzahl: d.fehleranzahl,
row : null,
col : null,
expectVal: null,
storedVal: null,
text: null,
__children : children
});
});
hot.getInstance().loadData(bar); // <--
hot.getInstance().render();
},
});
But on error Isee: this.data
is null. Does it is possible to fill data array by ajax?