Hi,
I am working on Angular 12 with Handsontable 12.
I am trying to add a list of objects inside renderer function as below(inside .ts file):
renderer(instance:any, td:any, row:any, col:any, prop:any, value:any, cellProperties:any)
{
for(var obj of this.resultList){
if(obj.name==value && obj.flag){
td.style.fontWeight = ‘bold’;
td.style.color = ‘red’;
td.innerText = value;
}
}
return td;
}
It is giving error in console as :
ERROR TypeError: Cannot read properties of undefined (reading ‘resultList’)
However, I have created “resultList” as global variable which holds Handsontable data.
The logic I am trying to add here is:
If the value matches with the Name in the list and flag is True then set Cell text-color to Red and fontWeight to bold
This I have added in HTML file.
Can anyone help with how to access Global Variable inside the renderer function ?
Thanks.