WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Xtree Bug?, Micha, May 1, 2003
     Re:Xtree Bug?, Micha, May 1, 2003

Subject: Re:Xtree Bug? From: Micha Date: May 1, 2003

Argh.. you'll need to pass the right function with a setTimeout :(

This new function works like a charm:

function tree_selectLastNode(){
  if(tree.getSelected().loading){
   treeTimer = setTimeout("tree_selectLastNode()",10);
  }else{
   if(window.treeTimer){
    clearTimeout(treeTimer);
   }
   tree.getSelected().getLast().focus();
  }
 }

From: Micha
Sent: May 1, 2003
Subject: Re:Xtree Bug?

The loaded property and open property is set to true despite the childNodes are not completely ready.

I select the last node in tree.getSelected(). Using a timer I wait until everything is ready with loading (using xloadtree). The alert in my script gives an error despite the fact there are 10+ childNodes beneath them.

 function tree_selectLastNode(){
  if(tree.getSelected().loaded && tree.getSelected().open){
   clearTimeout(treeTimer);
   alert(tree.getSelected().childNodes.length);
   //tree.getSelected().childNodes[childNodes.length-1].focus();
  }else{
   treeTimer = setTimeout("tree_selectLast()",10);
  }
 }





Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX