I handled it by extending TreeItemRenderer, overriding updateDisplayList() &
set theTreListData icon based on some condition in the node item.
override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void {
var tlData:TreeListData = TreeListData(super.listData);
var nodeData:NodeDescriptor= (tlData.item as NodeDescriptor);
if(nodeData.icon != null){
tlData.icon = node.icon;
}
}
the NodeDescriptor is a simple object that holds data specific to each node
(icon, label, etc...)
- Ivo
________________________________
From: Alan Rother <[email protected]>
To: [email protected]
Sent: Tuesday, December 23, 2008 12:11:11 PM
Subject: [flexcoders] - Tree Component Styling issue
Hey all,
I am building a sitemap tool in Flex 3. I want to be able to control all of the
icons at runtime based on the data provided back to Flex from ColdFusion (XML).
I have managed to get the leaf nodes icons controlled by the data provider, but
I cannot find a way to affect the folder icons at run time only globally. By
that I mean, I can set each and every leaf to any icon I choose, but I can only
get my folders to have one global look. I need to be able to define what icon
to use for each folder, as in this case each folder represents a parent page
and will have a status associated with it (active, locked, publishing, etc...)
Any one found a way to handle it ?
=]
--
Alan Rother
Adobe Certified Advanced ColdFusion MX 7 Developer
Manager, Phoenix Cold Fusion User Group, AZCFUG.org