This content has been marked as final. Show 4 replies
Don't give up on doing it with styles until you have to, but at some point you are going to have to go to a custom TreeItemRenderer. I have an exmple on www.cflex.net that is neither trivial not too complicated when you are ready.
I tried with styles but there is only the "color" one, and that one changes the whole text in a Tree, i just need to change some particular nodes, the ones which can be expanded (the ones with the folder).
I did a test to change a single one, i used the itemClick event which has an itemRenderer property and i applied the style to that itemRenderer and it worked, the thing is that it only works when i click on an item because the itemClick event has an itemRenderer property. I checked the reference on the Tree component and i don't find any way to iterate over the itemRenderers :(
Could you send me the exact url of the example you mentioned? I got a bit lost at that site, thanks Tracy
Ok, but first, you will NEVER iterate over itemRenderers. They are recycled, and only the visible ones even exist. Everything in a renderer must be data-driven. The critical parts in a full renderer are the set data() method, the commitProperties method and the updatedisplayList()
Here is that link:
Good example on how to achieve it, very simple in fact, can't believe i didn't think about it :P