Re: [flexcoders] - Tree Component Styling issue

2008-12-23 Thread ivo
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 
To: flexcoders@yahoogroups.com
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


RE: [flexcoders] - Tree Component Styling issue

2008-12-23 Thread Alex Harui
Use an iconFunction

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Alan Rother
Sent: Tuesday, December 23, 2008 12:11 PM
To: flexcoders@yahoogroups.com
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



Re: [flexcoders] - Tree Component Styling issue

2008-12-23 Thread Alan Rother
NEVERMIND...
Always happens... As soon as I send an email to the list, I find the
answer...


http://livedocs.adobe.com/flex/3/html/help.html?content=dpcontrols_8.html


private function loadIconClass(item:Object):Class
 {
 var type:String = item.icon;
 if (type == "Whatever")
 {
 return pdfIcon;
 }
 return docIcon;
 }

=]

-- 
Alan Rother
Adobe Certified Advanced ColdFusion MX 7 Developer
Manager, Phoenix Cold Fusion User Group, AZCFUG.org