jstree导航树

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: {  // 添加鼠标hover显示具体文本
							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  //可以获取所点击的节点的id 以及 text;
}

在这里插入图片描述

发布了17 篇原创文章 · 获赞 11 · 访问量 564

猜你喜欢

转载自blog.csdn.net/weixin_45563734/article/details/102821764