Text color depending on value in cell

Hello all,

Is it possible to set the text color of certain cells depending on the value in the cell? For example the text ‘failed’ should return as a red colored text. The text ‘completed’ should return as a green colored text.

I tried the following, but could not get this to work (I am using the free version at the moment):

[code] function eXcell_edncl(cell)
{
this.base = eXcell_edn;
this.base(cell);
this.setValue = function(val)
{
if (!val || val.toString()._dhx_trim() == “”);
val = “Passed”;
if (val = “Failed”)
this.cell.style.color = “green”;
else;
this.cell.style.color = “red”;
this.cell.innerHTML = this.grid._aplNF(val, this.cell._cellIndex);
}
}

eXcell_edncl.prototype = new eXcell_edn;[/code]

Thanks in advance for the support.

Unfortunately custom ExCell creation can be used in PRO version only.
You may try to define the color of your text right in your xml.
For example:

<row id="1"> <cell style="color:red;">Failed</cell> </row> <row id="2"> <cell style="color:green;">Passed</cell> </row>

1 Like