0
votes

I have DataGroup with custom item renderers, which can partly overlap each other. I have possibility to select these items. And I want selected item to be above others in the datagroup. But since DataGroup sets childIndexes (from left to right) to its children and we cannot change childIndex of items explicitly, selected item is above all items to the left and under all items to the right. So, what is the way to place selected item above others? I thought of using PopUpAnchor, but may be other solutions exist. Thanks

1

1 Answers

1
votes

You can use the ItemRenderer's depth property to achieve this. Just set it to 0 when the renderer is not selected and set it to 1 when it is.

Christophe Coenraets wrote a very clear article (with example) on this. No need for me to add anything to that.

http://coenraets.org/blog/2010/01/cool-itemrenderers-made-easy-in-flex-4/

The first example is the one you want. This example uses the 'hovered' state instead of 'selected', but the idea is the same.