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. > > > > > > > > > > > > > > >