user1550951
user1550951

Reputation: 379

Mouse-over event on JSTree

I am using a jstree to display information in an MVC Razor page. The code for jstree looks like this:

 $('#app_container').jstree({
                'core': {
                    'data': {
                        "url": "/controller/methodname",
                        "data": function (node) {
                                return { "id": node.id, "parent":node.parent };
                        }
                    }

                },
                "plugins": ["sort"]
       });

I want to add a mouse-over event on each node so it displays additional information. I've had a look at documentation but I'm not sure where do I have to add the event.

Upvotes: 6

Views: 3223

Answers (1)

Adam
Adam

Reputation: 2666

Try it as an event listener, completely independent of the jstree initialization code:

$('#app_container').on("hover_node.jstree", function (node) {
    // Your code here
});

Upvotes: 6

Related Questions