Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mouse-over event on JSTree

Tags:

json

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.

like image 424
user1550951 Avatar asked Jun 28 '16 07:06

user1550951


1 Answers

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

$('#app_container').on("hover_node.jstree", function (node) {
    // Your code here
});
like image 182
Adam Avatar answered Nov 30 '22 20:11

Adam