Bootstrap4.0兼容bootstrap-treetable方法

Bootstrap4.0中将一些图标被去除了,调整expanderExpandedClass 和expanderCollapsedClass 为Font Awesome的图标。

  $.fn.bootstrapTreeTable.defaults = {
        code: 'code',              // 选取记录返回的值,用于设置父子关系
        parentCode: 'parentCode',  // 用于设置父子关系
        rootIdValue: null,         // 设置根节点id值----可指定根节点,默认为null,"",0,"0"
        data: null,                // 构造table的数据集合
        method: "GET",               // 请求数据的ajax类型
        url: null,                 // 请求数据的ajax的url
        ajaxParams: {},            // 请求数据的ajax的data属性
        expandColumn: 0,           // 在哪一列上面显示展开按钮
        expandAll: false,          // 是否全部展开
        expandFirst: true,         // 是否默认第一级展开--expandAll为false时生效
        striped: false,            // 是否各行渐变色
        bordered: true,            // 是否显示边框
        hover: true,               // 是否鼠标悬停
        condensed: false,          // 是否紧缩表格
        columns: [],               //
        toolbar: null,             // 顶部工具条
        height: 0,                 // 表格高度
        showTitle: true,           // 是否采用title属性显示字段内容(被formatter格式化的字段不会显示)
        showColumns: true,         // 是否显示内容列下拉框
        showRefresh: true,         // 是否显示刷新按钮
        expanderExpandedClass: 'fas fa-angle-down', // 展开的按钮的图标
        expanderCollapsedClass: 'fas fa-angle-right', // 缩起的按钮的图标
        onLoadSuccess: null          // 加载完成后调用
    };

 

posted @ 2022-07-07 17:55  微风吹过~  阅读(823)  评论(0编辑  收藏  举报