:: Forum >>

Changing color of a particular row based on a condition

Hello, I'm using ActiveWidgets in a Java application and I need to show some lines in red, based on a condition (this condition is determined in the servlet). I don't know how to get my Java object to test the condition from the ActiveWidgets. Is it possible? Can anyone give me an example?
J-Chist
Friday, September 18, 2009

example with a cell

obj.defineRowProperty("Mycolor", function(row){
return this.getCellValue(0, row)=='A' ? "#AA0000" : null;
});


obj.getRowTemplate().setStyle("color", function(){
return this.getRowProperty("Mycolor");
});
Thierry
Saturday, September 19, 2009
See also -

http://www.activewidgets.com/javascript.forum.22349.3/how-to-let-dynamic-row.html
Alex (ActiveWidgets)
Monday, September 21, 2009
Thank you! It worked fine. I have a neu doubt now...
J-Chist
Tuesday, September 22, 2009
Thierry and Alex, you tips also helped solving my new doubt. The trouble was that I am using ActiveWidgets 1.4, so the methods getCellValue and getCellData do not work. But I got to change Thierry's example, doing so:

obj.defineRowProperty("Mycolor", function(row)
{
return this.getDataProperty("text", row, 21)=='atualizado' ? "#FF0000":"#000000";
});

obj.getRowTemplate().setStyle("color", function(){
return this.getRowProperty("Mycolor");
});


Thank you very much!!
J-Chist
Wednesday, September 23, 2009

This topic is archived.


Back to support forum

Forum search