Reputation: 1075
I'm using JSTree and it has shown to be an awesome tool. Using the Drag and Drop plugin I came across this:
When I drag a file to a folder with valid_children that does not allow files it does not show the red cross, but also does not allow to drop (as valid_children expected behavior). For a better user expecience I need to show the cross when the parent node's valid_children does not contain the node being dragged's type. Here is an example of what I am looking for:
Any ideas?
Upvotes: 1
Views: 648
Reputation: 1075
Found the solution and it differs a little from what I've found in StackOverflow
switch (operation) {
case 'move_node':
return ($.inArray(node.type, this.get_rules(more.ref).valid_children) != -1);
default:
return true;
}
Upvotes: 1