Hello,
I’ve colored cells in Employee Leave Balance Report.
but i’ve write code to color 2 columns on different conditions but it is only showing color on one column.
My Code is :
"formatter":function (row, cell, value, columnDef, dataContext, default_formatter)
{
value = default_formatter(row, cell, value, columnDef, dataContext);
value1 = default_formatter(row, cell, value, columnDef, dataContext);
if (columnDef.id == "Casual Leave Taken")
{
if(dataContext["Casual Leave Taken"]<5)
{
value = "<span style='color:red!important;font-weight:bold;'>" + value + "</span>";
}
}
if (columnDef.id == "Casual Leave Balance")
{
if(dataContext["Casual Leave Balance"]<20)
{
value1 = "<span style='color:green!important;font-weight:bold;'>" + value1 + "</span>";
}
}
return value;
return value1;
}
Result Is :
Please advise where i am doing mistake.
Thanks.