扩展 TreeTable 功能示例

develop
就眠仪式 2020-07-28 10:37:54 +08:00
parent 00d9bf815f
commit e57ebecc2d
2 changed files with 26 additions and 3 deletions

View File

@ -56,6 +56,14 @@
<i class="layui-icon layui-icon-delete"></i>
删除
</button>
<button class="pear-btn pear-btn-success pear-btn-md" lay-event="expandAll">
<i class="layui-icon layui-icon-spread-left"></i>
展开
</button>
<button class="pear-btn pear-btn-success pear-btn-md" lay-event="foldAll">
<i class="layui-icon layui-icon-shrink-right"></i>
折叠
</button>
</script>
<script type="text/html" id="power-bar">
@ -129,7 +137,6 @@
}
})
table.on('toolbar(power-table)', function(obj){
if(obj.event === 'add'){
window.add();
@ -137,7 +144,11 @@
window.refresh();
} else if(obj.event === 'batchRemove'){
window.batchRemove(obj);
}
} else if(obj.event === 'expandAll'){
treetable.expandAll("#power-table");
} else if(obj.event === 'foldAll'){
treetable.foldAll("#power-table");
}
});
window.add = function(){

View File

@ -56,6 +56,14 @@
<i class="layui-icon layui-icon-delete"></i>
删除
</button>
<button class="pear-btn pear-btn-success pear-btn-md" lay-event="expandAll">
<i class="layui-icon layui-icon-spread-left"></i>
展开
</button>
<button class="pear-btn pear-btn-success pear-btn-md" lay-event="foldAll">
<i class="layui-icon layui-icon-shrink-right"></i>
折叠
</button>
</script>
<script type="text/html" id="power-bar">
@ -137,7 +145,11 @@
window.refresh();
} else if(obj.event === 'batchRemove'){
window.batchRemove(obj);
}
} else if(obj.event === 'expandAll'){
treetable.expandAll("#power-table");
} else if(obj.event === 'foldAll'){
treetable.foldAll("#power-table");
}
});
window.add = function(){