3.2.0

Cell Color depneding on value of Cell

How do I change the color of a Cell dependant on it's value.

E.g. 0 it's red, over 5 it's blue.

I'm trying this:

grid.defineCellProperty("color", function(row, col){ 
    if (col = 7){	
        if (this.getCellValue(7, row) == 0)
        {
            strColour = "RED";
        }else if (this.getCellValue(7, row)>5)
        {
            strColour = "BLUE";
        }else
    } else {
        strColour = "WHITE";
    } 
    return strColour
    }) 

    grid.getCellTemplate(6).setStyle("background-color", function( ){ 
        return this.getCellProperty("color"); 
    });

Matt Thompson
August 14,
ignore me - i was getting the col wrong, it should have been column 7 :)

Literally found that 5 mins after posting, been looking on and off for 2 days!
Matt Thompson
August 14,

This topic is archived.

See also:


Back to support forum