-
Hello! First of thanks for all the work on jstree it has helped me out a lot :). I want to put an event on the nodes for when they are clicked ('select_node.jstree') but I'm also using the state plugin. Right now I'm adding the event when 'loaded.jstree' fires like so but it doesn't seem to be working consistently $('.jstree').on('loaded.jstree', function() {
$('.jstree').on('select_node.jstree', function(event, node) {
// ....
});
}); I'm not sure if what I'm trying to do is possible but thanks in advance for any help :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
you can attach your event even before creating the tree instance itself - that way you won't miss any actions. You can also check if the selection was triggered by user interaction by inspecting the event's data argument - there should be an |
Beta Was this translation helpful? Give feedback.
you can attach your event even before creating the tree instance itself - that way you won't miss any actions. You can also check if the selection was triggered by user interaction by inspecting the event's data argument - there should be an
event
property - if it is set - the selection was triggered by a user.