3.2.0

Rowes Colored based on Data

I am trying to color rows based on data, eg if the value of a certain cell is greater than 50 make it one color, else make it the other. this is what I have

obj.alternate = function()
{
    if(obj.getDataText(this.getProperty('row/order'),0)>50)
    {
        return '#ddffff';
    }
    else
    {
        return '#ffffdd';
    }
}
obj.getTemplate('row').setStyle('background', obj.alternate);

the problem with this, is that when I sort, the colors stay where they are instead of moving with the data... help please!
Travis Harris
November 10,
I guess you just have to change 'row/order' (which is display order) to 'row/index' (data array index).
Alex (ActiveWidgets)
November 10,
You win the Make Travis Happy award of the day!!! If you were here, I'd have to buy you a rootbeer float!
Travis Harris
November 11,

This topic is archived.

See also:


Back to support forum