开发者

Jstree how to configure contextmenu type wise and when add or delete node how to store it in database

am using

$("#demo1").jstree({ 
        "xml_data" : {
            "ajax" : {
                "url" : "phpxml.php",
                "data" : function (n) { 
                    return { 
                    "operation" : "get_children",
                    "id" : n.attr ? n.attr("id").replace("node_","") :1
}; 
                }
            }
        },
"plugins" : [ "themes", "xml_data" ,"ui","crrm","contextmenu","types"],
        "contextmenu" : 
        {
            items: 
            {
                "ccp" : false,
                "create" : 
                {
                                    "label" : "Create",

                    "action" : function (obj) { this.create(obj); },
                    "_disabled"  : function (obj) { alert("obj=" +开发者_如何学Python obj); return "default" != obj.attr('rel'); }
                },
    }
        },
});
});


You have to use like: "contextmenu" :{items: customMenu},
where customMenu is a function. You can see the same question: Configuring jstree right-click contextmenu for different node types

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜