I am using Handsontable in Angular application
I want to initialize handsontable instance once data is loaded from an API.
I don’t want to display blank handsontable on page load when there is no data loaded.
Thanks for quick reply. That solution solved my query.
However, now I’m facing different problem.
I’ve implemented same example for testing and it is working perfectly fine, but when I tried with HTTP response to bind with the handsontable it is not getting added into table.
It looks like similar issue.
In my case as well, when I tried same logic with static data it worked perfectly fine.
But when I integrated it with dynamic data and settings it is giving me that error also table is showing only with headers.
Handsontable Angular (forked) - StackBlitz. This seems to be working correctly though. Although it shows how I call the hot table since the table settings and data are dynamic.
It worked well for the issue author for dynamic data.
I tried the mentioned approach with both static and dynamic data.
For static data it is working fine, but getting same error when trying with dynamic data.
Can you please help resolve this issue?
The error comes from a minified version so o is not defined does not tell us much. You’d need to load the non-minified version.
However, I wonder if the issue is gone if you replace
this.hotSetting.data = this.subsidiaryList
to
hot.loadData(this.hotSetting.data) (where hot is the reference to the instance)
I don’t think I can reproduce the same issue on any JSFiddle as it is associated with lot of backend logic which returns dynamic data which will be shown to handsontable dynamically each time it is loaded.
Also there are multiple hooks I’m using as follow: afterCreateRow, beforeRemoveRow, afterRemoveRow, afterFilter, afterOnCellMouseDown, afterSelectionEnd
OK, I see. This is the older version of this demo https://handsontable.com/docs/javascript-data-grid/cell-renderer/ from paragraph Render custom HTML in header. That logic breaks if you use sorting like here https://jsfiddle.net/n7u8gard/ (once sorting is disabled, it works well). Why? Sorting adds it’s own element to the HTML structure of the header so if you set only the to TH.innerHTML it’s in conflict.
Understood!
Does this mean we can either render custom HTML in header or can have sorting for columns ?
Actually I’m only using custom HTML in header only for first column and rest of columns are normal.
Also I don’t want sorting on first column but require sorting for rest of the columns.
So is there any alternative to alter HTML header and have sorting for other columns (individual column sorting)?