Hello,
I’m using handsontable hot-table, in my Angular project, but i have some trouble with the detection of children element, my parent data are displayed in the table without problem but i have the following errors:
The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.
i dont understand why i have this errors because when i console.log the data for my table and i use it in jsfiddle with an exemple i found in a post with the same problem as me, it work perfectly, here is the jsfiddle: Handsontable example - JSFiddle - Code Playground
here is the declaration of my hot-table in my html file:
<hot-table class="type-1" [ngClass]="{'current-day': selectedDate === dateJ}" [data]="showDataType1"
[colHeaders]="true" [nestedHeaders]="displayHour1" [rowHeaders]="rowFilteredVisualTypeHeader"
[colWidths]="60"
[rowHeaderWidth]="190" [rowHeights]="40" readOnly="true" [nestedRows]="true" [licenseKey]="licenseKey">
</hot-table>
and how i fill it in my typescript file:
this.rowFilteredTypeHeader.forEach((_, index) => {
this.showDataType1.push(this.generateParent(this._dataType15m[index],0, 24,_));
});
here are the other function which are used to fill my data:
private generateParent(array: number[], start: number, end: number, type: string): object {
const arrayData = array.slice(start, end);
const convertedData = this.convertArrayToObject(arrayData);
convertedData['__children'] = this.generateChildren(start, end, type);
return convertedData;
}
private generateChildren(start: number, end: number, type: string): object[] {
const children = [];
this.besWithGroup.forEach(be => {
if (be.strikeGroupName === type) {
const childData = this.convertArrayToObject(be.strikeValues.slice(start, end));
children.push(childData);
}
});
return children;
}
private convertArrayToObject(arrayData: number[]): object {
return arrayData.reduce((obj, value, index) => {
obj[(index + 1).toString()] = value;
return obj;
}, {});
}
Does someone have an idea why my table doesn’t recognize the children ?