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");
                }
            });
        }
    

      

  • 相关阅读:
    从针对接口编程到依赖注入
    DataRow 数组转化成DataTable
    Math 类的方法概要
    .net控件
    字符串反转
    DataTable
    Enabled设置为False时,前景色和背景色也不改变的TextBox 并居中
    C# 四舍五入 (解决四舍六入五成双的问题)
    查询最后一条数据
    C# toString()
  • 原文地址:https://www.cnblogs.com/AaronYang/p/3560486.html
Copyright © 2011-2022 走看看