[flexcoders] Re: Tree Branch???

2008-02-21 Thread xmwang1982
great idea! thank you.

--- In flexcoders@yahoogroups.com, Rafael Faria
[EMAIL PROTECTED] wrote:

 Try to set your labelFunction to this one
 
 labelFunction = parseBranches
 
 
 
 
 
 private function parseBranches(item:XML):String
 {
   if (item.name() == folder) {
   [EMAIL PROTECTED] = true;
   }
   return [EMAIL PROTECTED];
 }
 
 
 
 
 --- In flexcoders@yahoogroups.com, xmwang1982 askycn@ wrote:
 
  Hi Ryan,
  
  Thanks. It seems data decriptor is only for reading properties, not 
  changing.
  
  Actually I think my problem is common, for example:
  
  Folder lable=1
 file name=file1.txt/
 Folder lable = 1.1/
  /Floder
  
  In the xml above, node named Folder should be always displayed as a 
  branch. However, the default of flex tree is, if the node doesn't 
  have sub nodes, display it as leaf. 
  
  So the question comes up, how to set isBranch property base on node 
  names?
  
  Thanks a lot.
  
  --- In flexcoders@yahoogroups.com, Ryan Frishberg rfrishbe@ 
  wrote:
  
   Check out dataDescriptor.  You should be able to google (or search
   these forums) for it and get something on how to use this feature.  
  If
   not, post back.
   
   -Ryan
   
   --- In flexcoders@yahoogroups.com, xmwang1982 askycn@ wrote:
   
Thanks Raf,

However, what I need is something called isBranchFunction, in 
  which
we can set isBranch property base on e.g. node name.

Thanks.

--- In flexcoders@yahoogroups.com, Rafael Faria
rafaelfaria.grupos@ wrote:

 actually you can define a function to labelFunction.
 
 Check

   
   http://blog.flexexamples.com/2007/10/29/defining-a-custom-label-
  function-on-a-flex-tree-control/
 
 
 raf
 
 --- In flexcoders@yahoogroups.com, xmwang1982 askycn@ wrote:
 
  Hi experts,
  
  Can we determine the isBranch property of a tree node in a
function? 
  I need to set this property according to XML node name. It 
  would be 
  nice if we can define a function like labelFunction. 
  However it
seems 
  not existing. 
  
  I don't want to translate my XML to new XML node lable=... 
  isBranch=..   How to set the property in runtime? Thanks.
 

   
  
 





[flexcoders] Re: Tree Branch???

2008-02-19 Thread Ryan Frishberg
Check out dataDescriptor.  You should be able to google (or search
these forums) for it and get something on how to use this feature.  If
not, post back.

-Ryan

--- In flexcoders@yahoogroups.com, xmwang1982 [EMAIL PROTECTED] wrote:

 Thanks Raf,
 
 However, what I need is something called isBranchFunction, in which
 we can set isBranch property base on e.g. node name.
 
 Thanks.
 
 --- In flexcoders@yahoogroups.com, Rafael Faria
 rafaelfaria.grupos@ wrote:
 
  actually you can define a function to labelFunction.
  
  Check
 

http://blog.flexexamples.com/2007/10/29/defining-a-custom-label-function-on-a-flex-tree-control/
  
  
  raf
  
  --- In flexcoders@yahoogroups.com, xmwang1982 askycn@ wrote:
  
   Hi experts,
   
   Can we determine the isBranch property of a tree node in a
 function? 
   I need to set this property according to XML node name. It would be 
   nice if we can define a function like labelFunction. However it
 seems 
   not existing. 
   
   I don't want to translate my XML to new XML node lable=... 
   isBranch=..   How to set the property in runtime? Thanks.
  
 





[flexcoders] Re: Tree Branch???

2008-02-19 Thread xmwang1982
Hi Ryan,

Thanks. It seems data decriptor is only for reading properties, not 
changing.

Actually I think my problem is common, for example:

Folder lable=1
   file name=file1.txt/
   Folder lable = 1.1/
/Floder

In the xml above, node named Folder should be always displayed as a 
branch. However, the default of flex tree is, if the node doesn't 
have sub nodes, display it as leaf. 

So the question comes up, how to set isBranch property base on node 
names?

Thanks a lot.

--- In flexcoders@yahoogroups.com, Ryan Frishberg [EMAIL PROTECTED] 
wrote:

 Check out dataDescriptor.  You should be able to google (or search
 these forums) for it and get something on how to use this feature.  
If
 not, post back.
 
 -Ryan
 
 --- In flexcoders@yahoogroups.com, xmwang1982 askycn@ wrote:
 
  Thanks Raf,
  
  However, what I need is something called isBranchFunction, in 
which
  we can set isBranch property base on e.g. node name.
  
  Thanks.
  
  --- In flexcoders@yahoogroups.com, Rafael Faria
  rafaelfaria.grupos@ wrote:
  
   actually you can define a function to labelFunction.
   
   Check
  
 
 http://blog.flexexamples.com/2007/10/29/defining-a-custom-label-
function-on-a-flex-tree-control/
   
   
   raf
   
   --- In flexcoders@yahoogroups.com, xmwang1982 askycn@ wrote:
   
Hi experts,

Can we determine the isBranch property of a tree node in a
  function? 
I need to set this property according to XML node name. It 
would be 
nice if we can define a function like labelFunction. 
However it
  seems 
not existing. 

I don't want to translate my XML to new XML node lable=... 
isBranch=..   How to set the property in runtime? Thanks.
   
  
 





RE: [flexcoders] Re: Tree Branch???

2008-02-19 Thread Jim Hayes
set an attribute of  'isBranch=true' on the xml node that you wish to
display as a branch
( ie [EMAIL PROTECTED] = true )
 
-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of xmwang1982
Sent: 19 February 2008 08:58
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Tree Branch???
 
Hi Ryan,

Thanks. It seems data decriptor is only for reading properties, not 
changing.

Actually I think my problem is common, for example:

Folder lable=1
file name=file1.txt/
Folder lable = 1.1/
/Floder

In the xml above, node named Folder should be always displayed as a 
branch. However, the default of flex tree is, if the node doesn't 
have sub nodes, display it as leaf. 

So the question comes up, how to set isBranch property base on node 
names?

Thanks a lot.

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Ryan Frishberg [EMAIL PROTECTED] 
wrote:

 Check out dataDescriptor. You should be able to google (or search
 these forums) for it and get something on how to use this feature. 
If
 not, post back.
 
 -Ryan
 
 --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com , xmwang1982 askycn@ wrote:
 
  Thanks Raf,
  
  However, what I need is something called isBranchFunction, in 
which
  we can set isBranch property base on e.g. node name.
  
  Thanks.
  
  --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com , Rafael Faria
  rafaelfaria.grupos@ wrote:
  
   actually you can define a function to labelFunction.
   
   Check
  
 
 http://blog.flexexamples.com/2007/10/29/defining-a-custom-label-
http://blog.flexexamples.com/2007/10/29/defining-a-custom-label- 
function-on-a-flex-tree-control/
   
   
   raf
   
   --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com , xmwang1982 askycn@ wrote:
   
Hi experts,

Can we determine the isBranch property of a tree node in a
  function? 
I need to set this property according to XML node name. It 
would be 
nice if we can define a function like labelFunction. 
However it
  seems 
not existing. 

I don't want to translate my XML to new XML node lable=... 
isBranch=.. How to set the property in runtime? Thanks.
   
  
 

 

__
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
__

[flexcoders] Re: Tree Branch???

2008-02-19 Thread Ryan Frishberg
It is a little confusing, but dataDescriptor is not a read-only
property.  You can create a custom data descriptor by extending
DefaultDataDescriptor (changing isBranch to what you want) and setting
 your Tree's dataDescriptor to that class.

-Ryan

--- In flexcoders@yahoogroups.com, xmwang1982 [EMAIL PROTECTED] wrote:

 Hi Ryan,
 
 Thanks. It seems data decriptor is only for reading properties, not 
 changing.
 
 Actually I think my problem is common, for example:
 
 Folder lable=1
file name=file1.txt/
Folder lable = 1.1/
 /Floder
 
 In the xml above, node named Folder should be always displayed as a 
 branch. However, the default of flex tree is, if the node doesn't 
 have sub nodes, display it as leaf. 
 
 So the question comes up, how to set isBranch property base on node 
 names?
 
 Thanks a lot.
 
 --- In flexcoders@yahoogroups.com, Ryan Frishberg rfrishbe@ 
 wrote:
 
  Check out dataDescriptor.  You should be able to google (or search
  these forums) for it and get something on how to use this feature.  
 If
  not, post back.
  
  -Ryan
  
  --- In flexcoders@yahoogroups.com, xmwang1982 askycn@ wrote:
  
   Thanks Raf,
   
   However, what I need is something called isBranchFunction, in 
 which
   we can set isBranch property base on e.g. node name.
   
   Thanks.
   
   --- In flexcoders@yahoogroups.com, Rafael Faria
   rafaelfaria.grupos@ wrote:
   
actually you can define a function to labelFunction.

Check
   
  
  http://blog.flexexamples.com/2007/10/29/defining-a-custom-label-
 function-on-a-flex-tree-control/


raf

--- In flexcoders@yahoogroups.com, xmwang1982 askycn@ wrote:

 Hi experts,
 
 Can we determine the isBranch property of a tree node in a
   function? 
 I need to set this property according to XML node name. It 
 would be 
 nice if we can define a function like labelFunction. 
 However it
   seems 
 not existing. 
 
 I don't want to translate my XML to new XML node lable=... 
 isBranch=..   How to set the property in runtime? Thanks.

   
  
 





[flexcoders] Re: Tree Branch???

2008-02-19 Thread Rafael Faria
Try to set your labelFunction to this one

labelFunction = parseBranches





private function parseBranches(item:XML):String
{
if (item.name() == folder) {
[EMAIL PROTECTED] = true;
}
return [EMAIL PROTECTED];
}




--- In flexcoders@yahoogroups.com, xmwang1982 [EMAIL PROTECTED] wrote:

 Hi Ryan,
 
 Thanks. It seems data decriptor is only for reading properties, not 
 changing.
 
 Actually I think my problem is common, for example:
 
 Folder lable=1
file name=file1.txt/
Folder lable = 1.1/
 /Floder
 
 In the xml above, node named Folder should be always displayed as a 
 branch. However, the default of flex tree is, if the node doesn't 
 have sub nodes, display it as leaf. 
 
 So the question comes up, how to set isBranch property base on node 
 names?
 
 Thanks a lot.
 
 --- In flexcoders@yahoogroups.com, Ryan Frishberg rfrishbe@ 
 wrote:
 
  Check out dataDescriptor.  You should be able to google (or search
  these forums) for it and get something on how to use this feature.  
 If
  not, post back.
  
  -Ryan
  
  --- In flexcoders@yahoogroups.com, xmwang1982 askycn@ wrote:
  
   Thanks Raf,
   
   However, what I need is something called isBranchFunction, in 
 which
   we can set isBranch property base on e.g. node name.
   
   Thanks.
   
   --- In flexcoders@yahoogroups.com, Rafael Faria
   rafaelfaria.grupos@ wrote:
   
actually you can define a function to labelFunction.

Check
   
  
  http://blog.flexexamples.com/2007/10/29/defining-a-custom-label-
 function-on-a-flex-tree-control/


raf

--- In flexcoders@yahoogroups.com, xmwang1982 askycn@ wrote:

 Hi experts,
 
 Can we determine the isBranch property of a tree node in a
   function? 
 I need to set this property according to XML node name. It 
 would be 
 nice if we can define a function like labelFunction. 
 However it
   seems 
 not existing. 
 
 I don't want to translate my XML to new XML node lable=... 
 isBranch=..   How to set the property in runtime? Thanks.

   
  
 





[flexcoders] Re: Tree Branch???

2008-02-18 Thread xmwang1982
Thanks Raf,

However, what I need is something called isBranchFunction, in which
we can set isBranch property base on e.g. node name.

Thanks.

--- In flexcoders@yahoogroups.com, Rafael Faria
[EMAIL PROTECTED] wrote:

 actually you can define a function to labelFunction.
 
 Check

http://blog.flexexamples.com/2007/10/29/defining-a-custom-label-function-on-a-flex-tree-control/
 
 
 raf
 
 --- In flexcoders@yahoogroups.com, xmwang1982 askycn@ wrote:
 
  Hi experts,
  
  Can we determine the isBranch property of a tree node in a
function? 
  I need to set this property according to XML node name. It would be 
  nice if we can define a function like labelFunction. However it
seems 
  not existing. 
  
  I don't want to translate my XML to new XML node lable=... 
  isBranch=..   How to set the property in runtime? Thanks.
 





[flexcoders] Re: Tree Branch???

2008-02-17 Thread Rafael Faria
actually you can define a function to labelFunction.

Check
http://blog.flexexamples.com/2007/10/29/defining-a-custom-label-function-on-a-flex-tree-control/


raf

--- In flexcoders@yahoogroups.com, xmwang1982 [EMAIL PROTECTED] wrote:

 Hi experts,
 
 Can we determine the isBranch property of a tree node in a function? 
 I need to set this property according to XML node name. It would be 
 nice if we can define a function like labelFunction. However it seems 
 not existing. 
 
 I don't want to translate my XML to new XML node lable=... 
 isBranch=..   How to set the property in runtime? Thanks.





[flexcoders] Re: Tree branch closed on display?

2007-10-07 Thread candysmate
--- In flexcoders@yahoogroups.com, Paul Dale [EMAIL PROTECTED] wrote:

 expandItem or expandChildrenOf on the root would do it (with the second
 param set to false ...)
 
 On 10/6/07, candysmate [EMAIL PROTECTED] wrote:
 
When my tree is first diaplayed, some of the branch nodes are
expanded
  by default. How can I have them closed by default?
 
   
 


Thanks Paul, I'll experiment with your suggestions.