jstree导航树
<link rel="stylesheet" href="/static/common/bootstrap-treeview/css/bootstrap-treeview.min.css" />
<script src="/static/metronic/assets/global/plugins/jquery.min.js" type="text/javascript"></script>
<script src="/static/metronic/assets/global/plugins/jstree/dist/jstree.min.js"></script>
success: function (res) {
for (var i = 0; i < res.data.length; i++) {
weixing.push({
id: res.data[i]._id,
"text": res.data[i].name,
"children": [{
text: "数据流",
a_attr: {
title: res.data[i].name,
class: "table-tboby-text"
},
"children": [{
text: "虚拟信道"
}, {
text: "模式"
}]
},
{
text: "分系统",
"children": [{
text: "单机"
}]
},
{
text: "地面设备"
},
{
text: "计算公式"
},
{
text: "校准方法"
},
]
})
}
$('#left').jstree({
'core': {
'data': weixing,
"check_callback": true
},
"contextmenu": {
select_node: false,
show_at_node: true
},
'plugins': ["search", "state"],
}).bind("activate_node.jstree", function (obj, e) {
var name = e.node
}