如何检查jstree中的编辑模式是否打开?可以检查吗?

How to check if the edit mode in jstree is on? Is it possible to check it?

我正在使用jsTree,我想获取我刚刚创建的节点的name/value/text,以便我可以传递它并将其存储在数据库中。 我的问题是在启用编辑模式后,我无法获取用户输入的值。 我的想法是,如果我只能确定编辑模式是打开还是关闭,那么我可以有点 运行 现在将获取用户输入的功能。我在这里包含了创建节点的功能。

非常感谢任何其他解决此问题的方法。提前致谢。

function demo_create(){
            var ref = $('#data').jstree(true),
            p_id = sel = ref.get_selected();
            console.log("Parent Id: "+p_id);   
            if(!sel.length) { return false; }
            sel = sel[0];
            id = sel = ref.create_node(sel, {"type":"file"});
            console.log("Newly Created Id: "+id);
            if(sel) {
                ref.edit(sel);
            }
        };

edit 将在节点名称更改后触发 rename_node.jstree

你也可以使用edit的回调:

ref.edit(sel, null, function (node, status) {
    console.log(node.text); // the new node title
})