How can I get the selected node on the loaded.jstree event?
what should I do in the event handler:
$('#Tree').bind('loaded.jstree', function(event, data){//TODO: How to get the selected node here?}).jstree();
By the way, I found out that the event data arg object contains a function called get_selected() but couldn’t get anything from it.
My purpose is to redirect the client to the current selected node (by ‘url’ attribute).
Thanks in advance
Seems according to the documentation of the demo here :
http://www.jstree.com/demo
you can do :
or
Read carefully the documentation as :
For the last event
delegate, instead of writingevent.preventDefault();, you can make your redirection correctly if you’re not using the UI plugin, and write :window.location = $(this).attr('href');