BF-202205051124\Administrator 2b159b6d13 no message 2 anos atrás
..
assets 2b159b6d13 no message 2 anos atrás
src 2b159b6d13 no message 2 anos atrás
.gitattributes 2b159b6d13 no message 2 anos atrás
.gitignore 2b159b6d13 no message 2 anos atrás
LICENSE 2b159b6d13 no message 2 anos atrás
README.md 2b159b6d13 no message 2 anos atrás
data.json 2b159b6d13 no message 2 anos atrás
index.html 2b159b6d13 no message 2 anos atrás

README.md

TreeView for bootstrapTable

demo

DEMO

http://imsense.site/bootstrapTable-treeView/

NOTICE

数据中必须包含parentId属性,根节点parentId=null,子节点中根据配置的parentId==options[treeId].

例如配置项中treeId='id',那么子节点的parentId属性值为父节点的id

Data must contain parentId properties,

rootNode parentId=null

childNode parentId=options[treeId]

if options treeId='id'

childNode's parentId property value isparnetNode's id value

USE

<script src="./src/bootstrap-table-treeview.js"></script>
  
$('#tree_table').bootstrapTable({
    class: 'table table-hover table-bordered',
    data: data,
    pagination: false,//分页请设置为false
    treeView: true,//是否开启树视图
    treeId: "id",//id字段
    treeField: "name",//展示树的字段
    columns: [{
        field: 'name',
        title: '名称',
    },
    {
        field: 'desc',
        title: '详情',
    },
    ]
});