简体   繁体   中英

Referencing and setting a single item renderer instance in a Flex Tree at runtime

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM