Is it possible to get parent tr element and set its style?
td.parentNode is null and td.parentElement is also null. Siblings are also null
i need to highlight a row if cell has a specific value.
function highlightRowRenderer(instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.TextRenderer.apply(this, arguments);
td.parentNode.style.background = 'yellow';
}
Thanks in advance.
Hi @maryja.radziuk
the parentNode
is accessible Handsontable example - JSFiddle - Code Playground but as it doesn’t have any style set it will return an error. If you console the td.parentNode
you’ll see that you’ll get some null
values.
If you are trying to add a background you will need to add it to the td element and if you want the whole row to be yellow just add the condition
if (row === 0) {
td.className = 'yellow'
}
(demo Handsontable example - JSFiddle - Code Playground)
If I am missing anything just let me know.
You’re welcome.
I assume that we can close the issue.