• EXTJS 遍历树


    var rootN=Ext.getCmp('treepanel').getRootNode();//获取树的根节点
            function setNodeDrag(cNo,pid){//遍历节点根据panelID查找相应的节点设置draggalbe为true
                var childnodes = cNo.childNodes;//获取根节点的子节点
                for(var i=0; i < childnodes.length; i++){
                   var cNode = childnodes[i];
                   if(cNode.id == pid)
                   {
                     cNode.draggable = true;
                   }
                   if(cNode.hasChildNodes()){
                     setNodeDrag(cNode,pid);//递归调用
                   }
                }
            }

    setNodeDrag(rootN,panel.id);//调用函数

  • 相关阅读:
    Robberies
    Big Event in HDU
    UVA 562 Dividing coins
    Little Rooks
    Bone Collector
    Piggy-Bank
    0-1背包问题之——饭卡
    Monkey and Banana
    The Triangle
    Burning Midnight Oil
  • 原文地址:https://www.cnblogs.com/luhaiyan/p/2046613.html
Copyright © 2020-2023  润新知