zoukankan      html  css  js  c++  java
  • EasyUI 的 combotree 加载数据后折叠起来,并且只允许单击子节点的写法

      $(source).combotree({
                url: '',
                 kuan,
                valueField: 'id',
                textField: 'text',
                onlyLeafCheck: true,
                onBeforeSelect: function (node) {
                    if (onlyLeaf) {
                        var t = $(this).tree;
                        var isLeaf = t('isLeaf', node.target);
                        if (!isLeaf) {
                            return false;
                        }
                    } else {
                        return true;
                    }
                },
                onLoadSuccess: function (row, data) {
                    $(source).combotree('tree').tree("collapseAll");
                }
            });
    

    自己研究过这个,kuan,是combotree的宽度设置,onlyLeaf表示是否只允许单击子节点,true,表示只允许单击子节点

    然后还有个功能,就是 加载成功后,折叠起来

     整体方法,我是这样子的

     function (source, params, kuan, onlyLeaf) {//onlyLeaf 是否只能是子节点单选
            if (kuan == null) kuan = 150;
            $(source).combotree({
                url: '/基本URL?' + params,
                 kuan,
                valueField: 'id',
                textField: 'text',
                onlyLeafCheck: true,
                onBeforeSelect: function (node) {
                    if (onlyLeaf) {
                        var t = $(this).tree;
                        var isLeaf = t('isLeaf', node.target);
                        if (!isLeaf) {
                            return false;
                        }
                    } else {
                        return true;
                    }
                },
                onLoadSuccess: function (row, data) {
                    $(source).combotree('tree').tree("collapseAll");
                }
            });
        }
    

      

  • 相关阅读:
    FTP 协议和 HTTP 协议的比较
    HttpURLConnection的post请求,什么时候发出,writeData存在什么地方
    装饰器
    函数参数以及名称空间作用域
    函数的调用
    函数的返回值
    定义函数的三种方式
    函数
    day05
    day04
  • 原文地址:https://www.cnblogs.com/AaronYang/p/3560486.html
Copyright © 2011-2022 走看看