Hi there!, I’m using hot-table (handsontable v10.0.0) tag and working with Angular(v11).
I’m initializing the table with the following:
child.html
Blockquote
<hot-table [hotId]=“hotTableId” [data]=“data” [settings]=“settings”>
child.ts
settings = {
filters: false,
cells: function(row) {
var cp = {type: ‘numeric’};
if (row === 0 || row === 2){
cp.type = ‘text’
}
else if (row === 1){
cp.type = ‘checkbox’
}
return cp;
},
rowHeaders: LABELS,
bindRowsWithHeaders: true,
rowHeaderWidth: 150,
colWidths: [165, 165, 165, 165, 165],
className: ‘htCenter’,
readOnly: true,
afterGetRowHeader: function(index, TH) {
var text;
let icon = ‘’;
const title1 = “title1”;
const title2= “title2”;
const title3= “title3”;
const title4 = “title4”;
const title5 = “title5”;
const title6 =“title6”;
const title7 = “title7”;
switch(index){
case 0:
text = title1;
break;
case 1:
text = title2;
break;
case 2:
text = title3;
break;
case 3:
text = title4;
break;
case 4:
text = title5;
break;
case 5:
text = title6;
break;
case 6:
text = title7;
break;
default:
text = undefined;
break;
}
if(text){
TH.setAttribute(‘title’, text);
TH.firstChild.firstChild.insertAdjacentHTML(‘beforeEnd’, icon);
}
TH.setAttribute(‘style’, ‘text-align:left’);
},
licenseKey: ‘non-comercial’
};
data = [
{
variant1 : “variant Name 1” ,
variant2 : “variant Name 2” ,
variant3 : “variant Name 3” ,
variant4 : “variant Name 4” ,
variant5 : “variant Name 5”
},
{
variant1 : true ,
variant2 : false ,
variant3 : false ,
variant4 : false ,
variant5 : false
},
{
variant1 : “Description variant 1” ,
variant2 : “Description variant 2” ,
variant3 : “Description variant 3” ,
variant4 : “Description variant 4” ,
variant5 : “Description variant 5”
},
{
variant1 : 0,
variant2 : 0,
variant3 : 0,
variant4 : 0,
variant5 : 0
},
{
variant1 : 0,
variant2 : 0,
variant3 : 0,
variant4 : 0,
variant5 : 0
},
{
variant1 : 0,
variant2 : 0,
variant3 : 0,
variant4 : 0,
variant5 : 0
},
{
variant1 : 0,
variant2 : 0,
variant3 : 0,
variant4 : 0,
variant5 : 0
},
{
variant1 : 0,
variant2 : 0,
variant3 : 0,
variant4 : 0,
variant5 : 0
},
{
variant1 : 0,
variant2 : 0,
variant3 : 0,
variant4 : 0,
variant5 : 0
},
{
variant1 : 0,
variant2 : 0,
variant3 : 0,
variant4 : 0,
variant5 : 0
},
{
variant1 : 0,
variant2 : 0,
variant3 : 0,
variant4 : 0,
variant5 : 0
},
{
variant1 : 0,
variant2 : 0,
variant3 : 0,
variant4 : 0,
variant5 : 0
}];
hotTableId = ‘idTable’;
here is the issue,
At the time of starting the application and showing the initial kick, the table is not shown but inspecting the code in the browser the table is built correctly, but has a style with width and height in zero. and is displayed only after rendering the screen or updating the table settings.
I tried to get the hot table with HotTableRegisterer and call the renderer function but still not displayed and if I add the call in the ts class constructor is throwing an error that getIntance(hotTableId) cannot find isDistroyed.
please let me know if you need anything else about this, I hope you can help me with it.