Cell background color gets reset when color is applied to another cell

Tags: #<Tag:0x00007efc62602a38>

Hi, I am having an issue where if I apply background color to a cell, it gets overwritten
whenever I apply color to another cell.

Here’s the code for it :

      let selected = hot.getSelected() || [];
      let selectedArray = selected[0];
      var cellRow = selectedArray[0];
      var cellColumn = selectedArray[1];

hot.updateSettings({
renderer(instance, td, row, col, prop, value, cellProperties) {
 if (row == cellRow && col == cellColumn) {
      td.style.backgroundColor = cellBackgroundColor;
  }
 }

Hi @fedev

Does something like this solves your problem?

https://jsfiddle.net/aszymanski/Lrb16knt/

In your solution you are using classes to apply color but we are using a color picker to apply colors to the cells.

td.style.backgroundColor = cellBackgroundColor;

Is there a way to achieve this without using classes .

Hi @fedev

I prepared an example based on renderer and it works fine:

https://jsfiddle.net/aszymanski/Lrb16knt/1/