0
votes

Anyone know how to change a single instance of an item renderer for a Flex tree item at runtime? To reiterate, I'm not trying to change the entire tree's item renderer like this:

    tree.itemRenderer = new ClassFactory(ItemRenderer2);

I'm trying to change the item renderer of a single tree item like this (the following code does not work):

    tree.selectedItem.itemRenderer = new ClassFactory(ItemRenderer2);

To put it more simply, does anyone know how to reference an instance of an item renderer and set it to a new item renderer class? I've tried using the Tree's itemToItemRenderer() method with no success.

I'd appreciate any help. Thanks!

Aaron

1

1 Answers

0
votes

I don't know, but on what does the choice of item renderer depend? Data? If so you could make your item renderer a ViewStack that changes depending on the data it receives.