javascript - 在展开和折叠事件时与 jstree 绑定(bind)

标签 javascript jquery jstree

我很难将 jstree 与 on-expand/on-collapse 事件绑定(bind)。我目前正在将 jstree 与 selected_node 事件绑定(bind),如下所示:

$(function () {
$("#tree").jstree({ 
"json_data" : {
    "data" : [
        { 
            data : "/", 
            attr : { "id" : "root"},
            state : "closed",
            "children" : [ { "data" : "child1",
                            "attr" : { "id" : "child1.id" },
                            "children" : [ ] }
                         ]
        },
    ]
},
"plugins" : [ "themes", "json_data", "crrm", "ui" ]
})
.bind("select_node.jstree",function(event, data) { . . . }

我现在也在 {...} 中为 on-expand/on-collapse 事件寻找相同的事件处理功能。需要帮助来弄清楚如何做到这一点。

最佳答案

.on('open_node.jstree', ....);

.on('close_node.jstree', ....);

关于javascript - 在展开和折叠事件时与 jstree 绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18878438/

相关文章:

javascript - 将真实类型作为参数传递给 JavaScript 中的方法

javascript - 网站上有一个与警报一起使用的代码,但在满足 if 条件时不会链接到另一个网站

javascript - 展开/折叠div时无法第二次调用jquery truncate插件

javascript - 如何访问 jstree 排序函数中的节点数据属性?

jquery - 如何选择拥有相同ID的每个节点

javascript - jQuery : Replace all unformatted text outside of html tags with multiple dropdown boxes

javascript - 如何将多个回调函数呈现给nodejs中的 View

javascript - 在 Jquery Mobile 中如何显示/隐藏 HTML 页面

javascript - 每次在div上滚动时执行jQuery函数

javascript - Changed.jstree 事件在类方法内部的 jstree 中不起作用