--- In [email protected], "Bill" <bill.frank...@...> wrote:
>
> is there any way to apply a styleFunction to a Grouping Field, so
that,
> for instance, the row is a different color based on which level of
> grouping it is?
>
> For Example
>
> Level 0 <- Red
> =>Level 1 <- Green
> =>=>Level 2 <- Blue
> =>=>->Item 1 <- default style
> =>=>->Item 2 <- default style
> =>Level 1 <- Green
>
You should be able to cast the dataProvider of the ADG to
HierarchicalCollectionView and then use getNodeDepth:
private function styleFields(data:Object,
column:AdvancedDataGridColumn):Object {
var dataProvider:HierarchicalCollectionView =
HierarchicalCollectionView(yourADG.dataProvider);
var depth:int = dataProvider.getNodeDepth(data);
switch(depth) {
case 0:
return {color:0xFF0000};
case 1:
return {color:0x00FF00};
case 2:
return {color:0x0000FF};
default:
return null;
}
}
HTH;
Amy
}