【问题标题】:Mouse-over event on JSTreeJSTree 上的鼠标悬停事件
【发布时间】:2016-06-28 07:11:41
【问题描述】:

我正在使用 jstree 在 MVC Razor 页面中显示信息。 jstree 的代码如下所示:

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

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

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

【问题讨论】:

    标签: json jstree


    【解决方案1】:

    作为事件监听器试试,完全独立于jstree初始化代码:

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

    【讨论】:

    • 如果其他人来这里看这个,请注意事件函数的签名是函数(事件,数据)。
    猜你喜欢
    • 2018-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    • 2012-10-12
    • 1970-01-01
    • 2016-08-08
    相关资源
    最近更新 更多