2 Star 9 Fork 2

Allen / combotree

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

combotree

介绍

基于layui及zTree的树下拉框组件

软件架构

在基于Layui开发后台管理系统时,想要一个下拉树控件控件,在网上找了一些开源的实现,都不是太满意,于是自己动手基于Layui 2.8.x及zTree 3.5.x制作了一个下拉树控件。实现了一个能用的版本,并不十分完善,有问题请自行修改或提出修改方案。

例子截图

单选多选

安装教程

下载combotree.js及layztree目录放在web工程的js相关静态资源文件保存目录即可。

使用说明

// 配置
layui.config({
  base: getCtxPath() + '/lib/extends/' // 假设这是存放拓展模块的根目录
}).extend({
  combotree: 'combotree'
});

layui.use(['combotree'],function() {
  var combotree = layui.combotree;
  // 渲染
  combotree.render({
    elem: '#elementId'
    ,placeholder: '请选择'
    ,isMultiple: false    // 是否多选,默认是单选
    ,yChkboxType: 'ps'    // 参考zTree该参数
    ,nChkboxType: 'ps'    // 参考zTree该参数
    ,expandLevel: '2'     // 默认展开的层级
    ,ajaxUrl: '/xxxxx'    // 取得树数据的url
    ,readonly: false      // 是否只读模式
    ,layVerify: 'required' // 是否是必选项目
    ,initValue: '100'      // 初期选中值,该值为树节点数据的ID,多个的时候以逗号分隔
  });  

})

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
MIT License Copyright (c) 2023 Allen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于layui及zTree的树下拉框组件 展开 收起
JavaScript 等 4 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/honestno1/combotree.git
git@gitee.com:honestno1/combotree.git
honestno1
combotree
combotree
master

搜索帮助