:: Forum >>

Row text color depending value of a cell

How can i apply format on a row depending of value in a cell on a specific column? (For example: on column 4 of grid i want text color red)

There is an example where only apply to the same cell but it's needed on entire row.

Can anyone help me?

DAS
Monday, May 17, 2004
var rowBackgroundCallback = function(){
var rowIndex = this.getProperty("row/index");
var qty = obj.getDataProperty("text", rowIndex, 3);
if( qty > 0 ){
return "LightGreen";
}
var rowOrder = this.getProperty("row/order");
return rowOrder % 2 ? "#EEEEEE" : "#FFFFFF";
}

var row = new Active.Templates.Row;
row.setStyle("background", rowBackgroundCallback);

obj.setTemplate("row", row);
danik
Monday, February 21, 2005
var rowBackgroundCallback = function(){
var rowIndex = this.getProperty("row/index");
var qty = obj.getDataProperty("text", rowIndex, 3); <--- not text but value, the rest is correct
if( qty > 0 ){
return "LightGreen";
}
var rowOrder = this.getProperty("row/order");
return rowOrder % 2 ? "#EEEEEE" : "#FFFFFF";
}

var row = new Active.Templates.Row;
row.setStyle("background", rowBackgroundCallback);

obj.setTemplate("row", row);
ez
Thursday, March 3, 2005

This topic is archived.


Back to support forum

Forum search