How can I disable moving in jsTree, but not disabling drag'n'drop plugin?
How to disable moving in jsTree 1.0, but not dis开发者_开发问答abling dnd plugin?
Thanks.
I found the solution.
$("#tree").jstree({
//...
"crrm" : {
"move" : {
"check_move" : function (m) {
return false;
}
}
}
//...
"plugins" : [ "crrm", "dnd" ]
});
"crrm" : {
"move" : {
"check_move" : function (m) {
if(m.cr.attr("id") == m.r.attr("id")){
return true;
}else{
return false;
}
}
}
}
精彩评论