:: Home >>

Alternate background colors

With a few steps you can enable alternate background colors on the grid.

The background color should be generated by the function depending on the row order in the grid.

var alternate = function(){
  return this.getRowProperty("order") % 2 ? "#fcfaf6" : "#ffffff";
}

Then you have to create a new row template.

var row = new Active.Templates.Row;

Assign a color function to the background color style.

row.setStyle("background", alternate);

An use this modified row template instead of standard one.

obj.setTemplate("row", row);

Comments

14 Jan 08
Change Row color based on data Hilman (1)
10 May 06
Good hari (0)
21 Mar 06
How about version 2.0? Rashad Rivera (1)
22 Jan 06
java-neandertal missing the rowboat Ron (1)
30 Dec 05
Grid.Extended Styles Mike Anonymous (2)
5 Oct 05
Alternate background color of each row (15)
30 Aug 05
Subclassing the Active.Controls.Grid Frank Gualtieri (7)
15 Aug 05
How to change row background color in gird based on a column value: reading data from csv text file.. krvmla (4)
27 Jan 05
Screen Refresh Issue Dragging Scrollbar Jason Phillips (5)
11 Nov 04
Rowes Colored based on Data Travis Harris (2)
14 Oct 04
Alternate row colors after sort? Bob Petrocelli (1)
12 Oct 04
Want look and feel of your website grid RichF (3)
4 Aug 04
Row Color thank you, Larry (2)
7 Jun 04
Alternate row colors Larry (1)

Comments will appear on this page and in the main forum.

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5