zoukankan      html  css  js  c++  java
  • zTree 节点名字过长解决方法

    var setting = {
            view: {
                showLine: false,
                addDiyDom: addDiyDom//在view中增加这个方法-----这个解决方法
            },
            data: {
                simpleData: {
                    enable: true
                }
            },
            callback: {
                beforeClick:zTreeOnClick
            },
            async:{
                contentType:"application/x-www-form-urlencoded",  
                enable:true,  
                type:"post",  
                url:"/servlet/ContentServer?pagename=spaceFlight/Page/companyCRUD_spaceFlight&crud=sellist"  
            }  
        };

    //下面定义这个方法:在下面自定义length长度,然后根据长度判断是否加上。。。。。

    function addDiyDom(treeId, treeNode) {
        var spaceWidth = 5;
        var switchObj = $("#" + treeNode.tId + "_switch"),
        icoObj = $("#" + treeNode.tId + "_ico");
        switchObj.remove();
        icoObj.parent().before(switchObj);
        var spantxt = $("#" + treeNode.tId + "_span").html();
        if (spantxt.length > 10) {
            spantxt = spantxt.substring(0, 10) + "...";
            $("#" + treeNode.tId + "_span").html(spantxt);
        }
    }

  • 相关阅读:
    How to configure security of ActiveMQ ?
    CentOS 搭建 nginx + tomcat
    25个 Git 进阶技巧
    写给Git初学者的7个建议
    my links
    Shell scripts to Create a local dir base on the time.
    81For全栈技术网
    一款可视化的在线制作H5
    在线制作h5
    在线制作h5——上帝的礼物
  • 原文地址:https://www.cnblogs.com/Han-org/p/6924347.html
Copyright © 2011-2022 走看看