1 Star 0 Fork 64

旭Bibby/layui-treetable

forked from 温山/layui-treetable 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
demo3.html 1.92 KB
一键复制 编辑 原始数据 按行查看 历史
温山 提交于 2017-12-11 10:03 . adding spreadable
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
<link rel="stylesheet" href="layui/css/layui.css">
</head>
<body>
<div id="demo"></div>
</body>
<script src="layui/layui.js"></script>
<script type="text/javascript">
layui.use(['tree', 'layer'], function(){
var layer = layui.layer;
layui.tree({
elem: '#demo',
check: 'checkbox', //输入checkbox则生成带checkbox的tree, 默认不带checkbox
skin: 'as', //设定皮肤
drag: true, //点击每一项时是否生成提示信息
checkboxName: 'selectedArr', //复选框的name属性值
checkboxStyle: "", //设置复选框的样式,必须为字符串,css样式怎么写就怎么写
click: function(item){ //节点点击事件
layer.msg('当前节名称:'+ item.name + '<br>全部参数:'+ JSON.stringify(item));
console.log(item);
},
nodes: [{
"id": "1",
"name": "父节点1",
"children": [{
"id": "11",
"name": "子节点11"
},
{
"id": "12",
"name": "子节点12"
}
]
},
{
"id": "2",
"name": "父节点2",
"children": [{
"id": "21",
"name": "子节点21",
"children": [{
"id": "211",
"name": "子节点211"
}]
}]
}
],
});
});
</script>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/zhbitbibby/layui-treetable.git
git@gitee.com:zhbitbibby/layui-treetable.git
zhbitbibby
layui-treetable
layui-treetable
master

搜索帮助