3.0 beta 2

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
January 7,
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)
January 8,
Cheers alex! Works a treat! Just wish I could have found it myself in documentation :(
January 9,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.