combotree树组件无限循环bug

原因分析:如果最后一个节点的state为closed时,未节点显示为文件夹,单击会重新加载动态(Url:链接地址)形成无限循环。

 

EasyUI combotree树组件无限循环,获取每个的最后节点

 

解决办法:将每个末节点state设置为open或者不设置state

 


 var lastchildren = [];
 forxh(json);  
 function forxh(list) {
 console.log(list)    
 console.log('--------------')    
 for (var i = 0; i < list.length; i++) {  
     var chlist = list[i];     
     console.log(chlist)      
     if (chlist.children.length > 0) {    
       forxh(chlist.children);      
     } else {      
       lastchildren.push(chlist);     
     }  
 }  
 }  
 console.info(lastchildren)

 

 

 

相关文章:

  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
猜你喜欢
  • 2021-11-08
  • 2022-12-23
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案