Hi,
I am wondering if it is possible to initiate the table like
new Handsontable() from typescript using a @ViewChild() in angular?
Please advice
Thank you
Hi,
I am wondering if it is possible to initiate the table like
new Handsontable() from typescript using a @ViewChild() in angular?
Please advice
Thank you
For anyone interested you may do it like below
ngOnInit() {
this.instance = document.getElementById('example1') as HTMLElement;
this.hotTable = new Handsontable(this.instance, {
data: this.dataObject,
columns: this.columns,
rowHeaders: true,
manualRowMove: true,
contextMenu: true,
afterGetRowHeader: function(row, TH) {
console.log(row);
TH.innerHTML = this.getDataAtRow(row)[0];
}
});
}
It is using HTMLElement however to access the element from template it is using getElementById
Thank you
Thank you for sharing an update.