Posted 7 September 2018, 8:29 am EST
Hi,
I am getting error below trying to set flex grid header information:
ERROR TypeError: Cannot read property ‘_hash’ of undefined
at e.setCellData (wijmo.grid.js:13)
In my code I insert row in columnHeaders and then call setCellData as below
this.flexGrid.columnHeaders.rows.insert(0, new Row());
this.flexGrid.columnHeaders.setCellData(0, 0, ‘user’);
What could be the reason I get this error?
What maybe unique in my code is that I need dynamically bind grid columns because columns are determined by number rows returned by the http endpoint.
I have a parent component and a grid child component. Grid component has columns as @Input. Parent component binds columns using ‘async’ pipe in its template.
When parent component makes http call and process response in its subscribe it calls next(columns) to bind columns with the grid component.
The following code is executed on ngOnChanges in the grid component.
this.flexGrid.columnHeaders.rows.insert(0, new Row());
this.flexGrid.columnHeaders.setCellData(0, 0, ‘user’);
Grid component on ngOnChanges binds grid with columns.
I suspect this error is result of dynamic binding columns to the grid initiated by asynchronous endpoint call.
thank you