change link color dynamically not working
I have a function that looks at cell values and if they are a negative number it changes their color property to red.
This is working fine except for cells that have a AW.Templates.Link template set.
Here is my function:
var addNegativeColor = function (obj,cells) {
obj.refresh();
obj.defineCellProperty("color", function(col, row){
if(cells.contains(col))
{
var val = this.getCellData(col, row);
return val < 0 ? "red" : "blue";
}
return "black";
});
obj.getCellTemplate().setStyle("color", function(){
return this.getControlProperty("color");
});
};
This is working fine except for cells that have a AW.Templates.Link template set.
Here is my function:
var addNegativeColor = function (obj,cells) {
obj.refresh();
obj.defineCellProperty("color", function(col, row){
if(cells.contains(col))
{
var val = this.getCellData(col, row);
return val < 0 ? "red" : "blue";
}
return "black";
});
obj.getCellTemplate().setStyle("color", function(){
return this.getControlProperty("color");
});
};
Jonathan Doklovic
February 8,