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

      

  • 相关阅读:
    STM32 ~ 查看系统时钟
    Allegro从.brd文件中导出器件封装
    Cadence原理图与Allegro交互
    Cadence关闭StartPage的方法
    emWin 移植
    python闭包
    python多线程之threading
    3.1决策树算法应用
    3.1决策树算法
    MyEclipse10 配置python的pyDev
  • 原文地址:https://www.cnblogs.com/AaronYang/p/3560486.html
Copyright © 2011-2022 走看看