I am using React and when I add a class to a cell with setCellMeta() it works but then when I select another cell the class is removed.
The code I use is something like this:
if (event.ctrlKey === true && event.key === 'b') {
let range = this.hotTableComponent.current.hotInstance.getSelectedRange()
this.hotTableComponent.current.hotInstance.deselectCell()
let startRow = range[0].from.row
let startCol = range[0].from.col
let endRow = range[0].to.row
let endCol = range[0].to.col
console.log(range, startCol, startRow, endCol, endRow)
for (let i = startCol; i <= endCol; i++) {
for (let j = startRow; j <= endRow; j++) {
this.hotTableComponent.current.hotInstance.setCellMeta(j, i, 'className', 'hot-col')
}
}
this.hotTableComponent.current.hotInstance.render()
}
I was just wondering what could cause this behaviour?