@aleksandra_budnik I use only cell setting the colors for the cells,
let listOfCells = [{"id":3042,"year":2019,"cells":"[{\"row\":0,\"col\":4}]","color":"rgba(237,251,11,1)"},{"id":3043,"year":2019,"cells":"[{\"row\":0,\"col\":4}]","color":"rgba(249,12,68,1)"},{"id":3044,"year":2019,"cells":"[{\"row\":1,\"col\":4},{\"row\":2,\"col\":4},{\"row\":3,\"col\":4},{\"row\":4,\"col\":4},{\"row\":5,\"col\":4},{\"row\":1,\"col\":4}]","color":"rgba(139,157,251,1)"},{"id":3045,"year":2019,"cells":"[{\"row\":1,\"col\":4},{\"row\":2,\"col\":4},{\"row\":3,\"col\":4},{\"row\":4,\"col\":4},{\"row\":5,\"col\":4},{\"row\":1,\"col\":4},{\"row\":1,\"col\":6},{\"row\":3,\"col\":6},{\"row\":3,\"col\":7},{\"row\":3,\"col\":8},{\"row\":1,\"col\":8}]","color":"rgba(14,249,235,1)"},{"id":3046,"year":2019,"cells":"[{\"row\":5,\"col\":6},{\"row\":5,\"col\":8},{\"row\":7,\"col\":6},{\"row\":7,\"col\":8}]","color":"rgba(249,12,68,1)"},{"id":3047,"year":2019,"cells":"[{\"row\":7,\"col\":7},{\"row\":6,\"col\":6},{\"row\":5,\"col\":7},{\"row\":6,\"col\":8}]","color":"rgba(237,251,11,1)"},{"id":3048,"year":2019,"cells":"[{\"row\":6,\"col\":7}]","color":"rgba(12,251,12,1)"},{"id":3049,"year":2019,"cells":"[{\"row\":6,\"col\":7}]","color":"rgba(40,12,251,1)"},{"id":4044,"year":2019,"cells":"[{\"row\":13,\"col\":7},{\"row\":12,\"col\":5},{\"row\":10,\"col\":5}]","color":"rgba(139,157,251,1)"},{"id":4045,"year":2019,"cells":"[{\"row\":1,\"col\":12}]","color":"rgba(237,251,11,1)"},{"id":4046,"year":2019,"cells":"[{\"row\":6,\"col\":12}]","color":"rgba(40,12,251,1)"},{"id":5045,"year":2019,"cells":"[{\"row\":1,\"col\":22},{\"row\":1,\"col\":22},{\"row\":1,\"col\":20},{\"row\":1,\"col\":18},{\"row\":1,\"col\":16},{\"row\":1,\"col\":14}]","color":"rgba(237,251,11,1)"},{"id":5046,"year":2019,"cells":"[{\"row\":5,\"col\":10}]","color":"rgba(139,157,251,1)"}]
self.tableInstance.updateSettings({
cells: function (row, col) {
let cellProperties = {}
if (listOfCells && listOfCells.length) {
for (let i = 0; i < listOfCells.length; i++) {
let cellRefs = listOfCells[i].cells ? JSON.parse(listOfCells[i].cells) : []
for (let j = 0; j < cellRefs.length; j++) {
if (row === cellRefs[j].row && col === cellRefs[j].col) {
cellProperties.style = { id: 4, background: listOfCells[i].color, color: listOfCells[i].color ? self.setColorBasedOnBackColor(listOfCells[i].color) : '' }
cellProperties.renderer = self.colorsRenderer
}
}
}
}
return cellProperties
}
})
so each time when they apply color, I used to add it as the new entry in the DB with rows and cols and apply colors for them
Is there anything that I do wrong here?
Please help me