Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Jstree onclick重命名问题_Javascript_Jquery_Jquery Plugins_Jstree - Fatal编程技术网

Javascript Jstree onclick重命名问题

Javascript Jstree onclick重命名问题,javascript,jquery,jquery-plugins,jstree,Javascript,Jquery,Jquery Plugins,Jstree,我正在读取一个使用jstree保存在localStorage中的xml文件。对于jstree的大多数功能来说,它工作得很好,但是我不知道如何在标签上单击鼠标就可以编辑节点。我尝试在我拥有的标记上点击事件,但无法将重命名顺序发送给jstree函数 这是我的,但它不起作用,请帮帮我 $(target).jstree({ "themes": { "theme": "classic", "icons":false, "dots":true }, "core": { "initially_ope

我正在读取一个使用jstree保存在localStorage中的xml文件。对于jstree的大多数功能来说,它工作得很好,但是我不知道如何在标签上单击鼠标就可以编辑节点。我尝试在我拥有的
  • 标记上点击事件,但无法将重命名顺序发送给jstree函数

    这是我的,但它不起作用,请帮帮我

    $(target).jstree({ 
    "themes": {
    "theme": "classic", 
    "icons":false,
    "dots":true 
    },
    
    "core": { 
    "initially_open": [ "#hide" ],
    "animation": 300 
    }, 
    
    "plugins": [ "themes", "html_data","dnd","crrm" ], 
    "callback": { 
        "ondblclk": "function(n){alert()}"
    }
    });
    

    试试这个,这是一个标准的绑定函数

    .bind("rename.jstree", function (e, data) {
            $.post(
                "./server.php", 
                { 
                    "operation" : "rename_node", 
                    "id" : data.rslt.obj.attr("id").replace("node_",""),
                    "title" : data.rslt.new_name
                }, 
                function (r) {
                    if(!r.status) {
                        $.jstree.rollback(data.rlbk);
                    }
                }
            );
        })