List Info

Thread: Re: RECURSE DYNAMIC TREE




Re: RECURSE DYNAMIC TREE
country flaguser name
United States
2008-07-07 04:02:45

You're great man ! Is it really fun ! I still need to adjust a little
bit some other things but the trick(in fact is a code) works ) ! Is
reaaly hard with these async requests and responses and but Thank
you !

--- In ydn-javascript%40yahoogroups.com">ydn-javascriptyahoogroups.com, "ozgursusoy"; <ozgursusoy...>
wrote:
>
&gt; --- In ydn-javascript%40yahoogroups.com">ydn-javascriptyahoogroups.com, "malutanpetronel"
&gt; <malutanpetronel> wrote:
&gt; >
>; > results is containig a list of node id's
>; > node is tree.getRoot() on the first call
>; >
> > function expandRecursive(node,results){
> > var node;
&gt; > var results = results.toString();
> > alert(node.children.length + " " + results);
> > for (var ki=0, kj=node.children.length; ki<kj; ki++) {
> > var childnode = node.children[ki];
> > var idtoSearch = childnode.data.id;
> > if (parseInt(results.indexOf(idtoSearch)) >=
0){
&gt; > //childnode.expand();
>; > expandRecursive(childnode,results);
> > }
>; > }
> > }
> >
> > all works if i expand manually all the nodes in my dyanmic tree
based
> > on the YUI example
> >
> > if the nodes are not expanded before, than the procedure fail
>; >
> > how can I fix it or how to do it differently please ? what event
and
> > where to insert it ?
> >
> > With kind regards
> > Petronel
> >
>;
> in your for loop:
&gt;
> _tree.subscribe(&quot;expandComplete", function (node, arg) {
> if (node == childnode){
> _tree.unsubscribe(&quot;expandComplete&quot;);
>; //code to set new childNode reference
> expandRecursive(childnode,results);
>; }
> });
>
> fun to watch it work
>

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )