:: Documentation >>

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

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

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