I'm working with jstree with ajax and I see that all my nodes have the arrow to expand it, even those which have no children. On the demo page of jstree http://www.jstree.com/demo this is not the case. I don't see on the demo code something different from mine, so does it come from the server ? Have I a parameter to put in response of "getChildren" method to say at jstree "this one, have no children, don't enable to expand it"?
Anyone know from where it come from? And what can I do to fix that ?
Because it seems to be a problem when I used the copy / paste function of the contextmenu plugin. When I paste on a node (the new parent) with no children and not yet open (so children haven't been loaded), nothing happen except the request to get children (like if I click to open the node) that return nothing obviously. And it doesn't execute the move_node function.
EDIT : I have the same problem with "add" from the contextmenu
Someone can help me ?
Thanks
From the jsTree documentation:
http://www.jstree.com/documentation/html_data
one of the three classes will be applied depending on node structure :
<li class="[ jstree-open | jstree-closed | jstree-leaf ]">
Jonathan Stowell is right, but setting attr.class to "jstree-leaf" won't work (at least not on the latest version).
But "open" and "closed" reminded me of node.state, so I tried, and it turned out that when you set node.state to "leaf" in your JSON serialzation class, it will be non-expandable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With