2016-06-28 224 views
2

我正在使用jstree在MVC Razor页面中显示信息。 jstree的代码如下所示:JSTree上的鼠标悬停事件

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

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

我想在每个节点上添加一个鼠标悬停事件,以便显示其他信息。我看过documentation,但我不确定我必须在哪里添加活动。

回答

2

尝试,因为事件侦听器,完全独立于jstree初始化代码:

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