:: Forum >>

AW.UI.List alternate colours

Hi, I was wondering how to get alternate background colours for the aw.ui.list? I have tried using a similar approach as used in the grid but I couldn't get it to work,

Any help would be great! Cheers!
James Crow
Sunday, January 7, 2007
Define odd/even colors in CSS:
.aw-alternate-even {
    background: red;

Add 'alternate' class to the list item template:

var obj = new AW.UI.List;
function alternate(){
    return this.getViewProperty("position") % 2 ? "odd" : "even";

obj.getItemTemplate().setClass("alternate", alternate);

Alex (ActiveWidgets)
Monday, January 8, 2007
Cheers alex! Works a treat! Just wish I could have found it myself in documentation :(
Tuesday, January 9, 2007

This topic is archived.

Back to support forum

Forum search