zoukankan      html  css  js  c++  java
  • easyui的tree节点的获取和选中

    easyui的tree节点的获取和选中

    学习了:http://www.cnblogs.com/fanyf/p/6863212.html

    function txtICDKeyup001(e){
        if(e.keyCode==13){ // 输入回车之后进行查询
            $('#txtICD').attr('disabled','disabled'); // 暂时禁用
            $('#txtICD').removeAttr('disabled');
            $('#divTreeId').tree({
                  data : [ {
                    "id" : 1,
                    "text" : "Folder1",
                    "iconCls" : "icon-save",
                    "children" : [ {
                        "id":2,
                        "text" : "File1" 
                    }, {
                        "id":3,
                        "text" : "Books",
                        "state" : "closed",
                        "children" : [ {
                            "id":4,
                            "text" : "PhotoShop" ,
                            state:'open'
                        }, {
                            "id" : 8,
                            "text" : "Sub Bookds",
                            "state" : "closed"
                        } ]
                    } ]
                }, {
                    "text" : "Languages",
                    "state" : "closed",
                    "children" : [ {
                        "text" : "Java"
                    }, {
                        "text" : "C#"
                    } ]
                } ]  ,
                  idField:"id",
                  treeField:"code",
                  animate:true,
                  lines:true,
                  "checkbox":true,
                  onlyLeafCheck:true,
                  title:'title...'
            });
            
            var node = $('#divTreeId').tree('find', 4);//找到id为”tt“这个树的节点id为”1“的对象
            $('#divTreeId').tree('expandTo', node.target);
            $('#divTreeId').tree('select', node.target);//设置选中该节点
            
        }
    }
  • 相关阅读:
    递推数列
    大数阶乘
    成绩排序
    DevC++ return 1 exit status
    POJ 1061 青蛙的约会
    ZOJ 2750 Idiomatic Phrases Game
    nyoj 545 Metric Matrice
    nyoj 308 Substring
    nyoj 515完全覆盖 II
    nyoj 1248 海岛争霸
  • 原文地址:https://www.cnblogs.com/stono/p/7806378.html
Copyright © 2011-2022 走看看