3.2.0

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
September 18,

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
September 19,
See also -

http://www.activewidgets.com/javascript.forum.22349.3/how-to-let-dynamic-row.html
Alex (ActiveWidgets)
September 21,
Thank you! It worked fine. I have a neu doubt now...
J-Chist
September 22,
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
September 23,

This topic is archived.

See also:


Back to support forum