本文介绍了jstree:dblclick绑定参数数据未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用良好的lib jstree ,但是dblclick绑定存在一些奇怪的问题.这是我的代码

I try to use good lib jstree but i have some strange problem with dblclick binding.Here is my code

$("#basic_html").jstree({
    themes: {
        url: "http://mywork/shinframework/shinfw/themes/redmond/css/jstree/default/style.css"
    },
    "plugins" : ["themes","html_data","ui","crrm","hotkeys", "core"],
});

$("#basic_html").bind("dblclick.jstree", function (e, data) {
    alert(e);
    alert(data);
});

当此代码运行并且我对某些节点进行dblclick时,我可以看到2条警报.第一个是object-正确,第二个是undefined-但是我想接收数据信息.

When this code runs and i make dblclick for some node i can see 2 alerts. The first is object -right, the second is undefined - BUT i want receive data information.

如果某些专家解决了此问题,请给我正确使用dblclick的正确方法,并接收有关我被单击的节点的数据"信息.

Please, if some specialist solve this problem give me right way for correct use dblclick and receive "data" information about node who is i clicked.

谢谢

推荐答案

$("#basic_html").bind("dblclick.jstree", function (event) {
    var node = $(event.target).closest("li");//that was the node you double click
});

这就是您想要的代码.

这篇关于jstree:dblclick绑定参数数据未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-26 17:04