This can be processed out of the box without any additional features:
$("#tree").jstree({ "types" : { "valid_children" : [ "root" ], //<== THIS IS THE IMPORTANT ONE ! "types" : { "default" : { "valid_children" : "none" }, "root" : { "valid_children" : "default" } } } });
You can specify "valid_children" inside each of your node types, but also one level higher (check the code above, where it says "IT IS IMPORTANT ONE".
This globally will only allow your ROOT node to have children, which means that you cannot pull anything from the root, but everywhere inside the root tree.
gb5256
source share