:: Forum >>

Background color row / data

Good morning,

I'm French, and I have just discovered ActiveWidgets, it's amzing, Thank you for it !!

First, I'm sorru for my language, I know I make lot of mistckes when I write in English, but I'm learning !!

This is my problem... I would like to choose a color to each "continent"

- <record>
<country code="us">United States</country>
- <record>
<country code="cn">China</country>
- <record>
<country code="jp">Japan</country>


- <record>
<country code="de">Germany</country>

Also, there are the five continents, how the choose a row color for each continents?
Tuesday, October 28, 2008
First, you'd want to disable the default style (or not enable them). These would be .aw-mouseover-row and .aw-rows-selected

Next, you'll need to write some JavaScript to set the colour. This code does it for the text colour of a cell -
obj.setCellColor(function(col, row)
switch (col)
case 6:
return this.getCellText(col, row).indexOf('text') == 0 ? "black" : "red"
case 8:
return this.getCellText(8, row).indexOf('some text') == 0 ? "red" : "black"
return "black"
obj.getCellTemplate().setStyle("color", function(){
return this.getCellProperty("color")})

So it looks at the contents of columns 6 and 8 and sets the text colour of the column accordingly.

So, for the background colour of a row, you'd want to define a row property for the background, then set the row background colour based on the contents of your desired column by calling getRowTemplate().
Wednesday, October 29, 2008
Thank you very much Anthony !!
Friday, October 31, 2008

I have try this but it does not work... Could you explain me ?
Friday, October 31, 2008

This topic is archived.

Back to support forum

Forum search