$('#jstree').jstree({
"core": {
"animation": 0,
"check_callback": true,
"multiple": false,
"themes": {"stripes": true},
'data': function (obj, callback) {
$.ajax({
url: "" + address + "/api/esb/datamgr/dataTree/v1", //这个是获取数据的ajax
type: 'post',
dataType: 'json',
async: true,
success: function (result) {
var data = result.Envelope.Body.busiData;
callback.call(this, data);
}
});
}
},
"types": {
"#": {
"valid_children": ["root"]
},
"root": {
"icon": "/static/3.3.5/assets/images/tree_icon.png",
"valid_children": ["default"]
},
"default": {
"valid_children": ["default", "file"],
"icon": false
},
"file": {
"icon": null,
"valid_children": []
}
},
"plugins": [
"contextmenu", "search",
"state", "types", "wholerow"
],
"search": { "show_only_matches" : true}, //搜索只显示搜索到的结果以及父节点
"contextmenu": { //右键菜单的配置
"items": {
"create": null,
"rename": null,
"remove": null,
"ccp": null,
"add": {
"label": "新建数据",
"icon": "glyphicon glyphicon-plus",
"action": function (data) {
var inst = $.jstree.reference(data.reference),
jstree个人使用记录
最新推荐文章于 2018-08-08 16:38:37 发布