Re: tree widget: too much recursion

"Christian Boulanger (Bibliograph Development)" <[email protected]> Tue, 25 Jan 2005 17:23:57 +0100
Newsgroups gmane.comp.windows.devel.netwindows
Message-ID <[email protected]>
Hello!

Does anyone know why I am getting a "too much recursion" error on 
Mozilla with the following addition to the NW Tree Widget:

NWTELP.getElementsByNodeName = function(name)
{
       
    if(!this.children||!this.children.length) return false;
   
    for(var i=0;i<this.children.length;i++){
           
            var list = this.children[i].getElementByNodeName(name);
           
            if(this.children[i].name==name){
                    if (list.length) list.push(this.children[i]);
                    else list = [this.children[i]];
            }
    }       
    return list ? list : false;
}

This is called on a tree with 200 nodes - not too much recursion 
alltogether.

Thanks,

Christian

_______________________________________________
The netWindows developers list: [email protected]
http://netwindows.org/mailman/listinfo/devel_netwindows.org