Jstree set_type

倾然丶 夕夏残阳落幕 提交于 2019-12-08 05:20:39

问题


I'm binding a set_type method to my jstree instance, and then calling the set_type method when clicking a button. Here's my code:

$("#treeDiv").jstree({..}).bind("set_type.jstree", function(e, data) {
            $.post(
                "./classes/jstree/_demo/server.php", 
                {
                    "operation" : "set_type", 
                    "id" : data.rslt.obj.attr("id").replace("node_",""),
                    "type" : data.rslt.obj.attr("type")
                }, 
                function (r) {
                    if(!r.status) {
                        $.jstree.rollback(data.rlbk);
                    }
                }
            );
        });


$("#settype").click(function() {
    $("#treeDiv").jstree("set_type", "block", "#node_663");
});

Type of the icon changes, but the type value dosen't changes in db. What am I doing wrong?


回答1:


Solved it. I found that class.tree.php has no method that updates type in the database.



来源:https://stackoverflow.com/questions/3633834/jstree-set-type

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!