一个小技巧,如何禁止jsTree的可以拖拽的问题.
//jsTree的初始化
treeObj = $('#jstree_container').jstree({
'plugins': ["contextmenu","dnd", "search", "state", "types", "wholerow"],
'core': {
"animation": 0,
"check_callback": true,
'force_text': true,
"themes": { "stripes": true },
'data': function (obj, callback) {
abp.ajax({
"url": "your url",
"success": function (result) {
if (result && result.length > 0) {
result[0].parent = "#";
} else {
abp.message.warn("say sth");
}
callback(result);
}
});
}
},
其实很简单的啦,不想使用JSTree的拖拽功能,将页面中jstree的plugins中dnd项去掉便可.看上面的代码
网友评论