/** 
     * 递归查找目标节点 
     */  
    function findTarget(obj,targetId,targetChildren){  
        if(obj.id==targetId){  
              obj.children=targetChildren;  
              return true;  
        }else{  
              if(obj.children!=null){  
                   for(var i=0; i<obj.children.length; i++){  
                        var flag=findTarget(obj.children[i],targetId,targetChildren);  
                        if(flag==true){  
                              return true;  
                        }  
                   }  
              }  
        }  
        return false;  
    } 

相关文章:

  • 2021-12-19
  • 2022-12-23
  • 2021-12-19
  • 2021-12-19
  • 2021-05-06
  • 2022-12-23
猜你喜欢
  • 2021-07-25
  • 2022-01-25
  • 2021-12-19
  • 2022-12-23
  • 2021-12-29
相关资源
相似解决方案