我使用JsTree,我的目标是没有子节点,根本没有层次结构,只有根节点。我看到版本 1.0rc3 的旧示例here(仅重新排序)并且工作正常,但我需要在 3.0.2 版本中使用相同的功能; t包括crrm插件。
有什么想法?提前谢谢。
配置v1.0rc3
{
"crrm" : {
"move" : {
"check_move" : function (m) {
var p = this._get_parent(m.o);
if(!p) return false;
p = p == -1 ? this.get_container() : p;
if(p === m.np) return true;
if(p[0] && m.np[0] && p[0] === m.np[0]) return true;
return false;
}
}
},
"dnd" : {
"drop_target" : false,
"drag_target" : false
},
"plugins" : [ "themes", "html_data", "crrm", "dnd" ]
});
}
答案 0 :(得分:0)
发现它!
"core": {
"check_callback": true,
'data': [...]
},
"types": {
"default":{
"max_depth": 0,
},
},
"plugins": ["dnd","types"]
上的创作者的另一个修复
core : {
check_callback : function (op, node, par, pos, more) {
if((op === "move_node" || op === "copy_node") && node.parent !== par.id) { return false; }
return true;
}, ...