开发者

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

开发者 https://www.devze.com 2023-03-09 20:28 出处:网络
am using $(\"#demo1\").jstree({ \"xml_data\" : { \"ajax\" : { \"url\" : \"phpxml.php\", \"data\" : function (n) {

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

精彩评论

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