Hello, I found a solution extending ADG. I'll post here if anyone need it
too.
Just override drawRowBackgrounds and use alternatingItemColors properties.
CODE:
override protected function drawRowBackgrounds():void
{
var rowBGs:Sprite = Sprite(listContent.getChildByName("rowBGs"));
if (!rowBGs)
{
rowBGs = new FlexSprite();
rowBGs.mouseEnabled = false;
rowBGs.name = "rowBGs";
listContent.addChildAt(rowBGs, 0);
}
var color:Object;
var depthColors:Boolean = false;
var colors:Array = getStyle("alternatingItemColors");
color = getStyle("backgroundColor");
if (!colors || colors.length == 0)
return;
StyleManager.getColorNames(colors);
var curRow:int = 0;
var i:int = 0;
var actualRow:int = verticalScrollPosition;
var n:int = listItems.length;
var alternateRoot:int = verticalScrollPosition;
while (curRow < n)
{
if (listItems[curRow][0])
{
var d:int = getDepth(listItems[curRow][0].data);
if(d == 1){
alternateRoot++;
}
drawRowBackground(rowBGs, i++, rowInfo[curRow].y, rowInfo[curRow].height,
colors[alternateRoot % colors.length], actualRow);
}
else
{
drawRowBackground(rowBGs, i++, rowInfo[curRow].y, rowInfo[curRow].height,
uint(color), curRow);
}
curRow++;
actualRow++;
}
while (rowBGs.numChildren > i)
{
rowBGs.removeChildAt(rowBGs.numChildren - 1);
}
}
--
Jhonny Everson