Describe the bug
Using a custom formatter, setting the cell style/background color does not work in IE 11. It does work in Chrome.
Tabulator Info
Working Example
https://jsbin.com/tesuteveye/1/edit?html,js,output
To Reproduce
Create a column with a custom formatter and set the cell style/background color.
Background does not change
Expected behavior
I expect the cell background color to be set.
Desktop (please complete the following information):
{title: "Total Conformance Rating", field: "conformrating", formatter: function (cell,
formatterParams)
{
//cell - the cell component
//formatterParams - parameters set for the column
var value = cell.getValue();
if (value === "Poor") {
cell.getElement().style = "background-color: #FF9999";
}
else if (value === "Fair") {
cell.getElement().style = "background-color: #FFFF99";
}
else if (value === "Good") {
cell.getElement().style = "background-color: #99ff99";
}
return value;
},
}
Hey @rs199483
That is because you are not setting the style correctly, you should not be setting the style property to a string, it should be treated as an object:
cell.getElement().style.backgroundColor = "#FF9999";
I hope that helps,
Cheers
Oli :)
Oli,
Just to clarify, it should be style.backgroundColor. Yes, this works now in both Chrome and IE11. Thanks!
cell.getElement().style.backgroundColor = "#FF9999";
Thanks, i have a dodgey full stop key on my keyboard lol
No problem Oli. You're doing a fantastic job! Happy holidays.
Most helpful comment
No problem Oli. You're doing a fantastic job! Happy holidays.