jstree remove default elements from context menu

前端 未结 4 2086
独厮守ぢ
独厮守ぢ 2021-02-07 07:12

I have a problem with JsTree\'s contextmenu, how can I remove the default elements from the contextmenu like Create, Delete, Rename? I want to provide elements of my own, but th

4条回答
  •  离开以前
    2021-02-07 07:45


    Set ccp, create, rename, remove to false like this :

    plugins : ["themes","json_data","ui","crrm", "hotkeys", "types", "contextmenu"],
    contextmenu : {
        items : {
            "IsimVer" : {
                "label" : "IsimVer",
                "action" : function (obj) { alert("IsimVer"); }
            },
            "Ekle" : {
                "label" : "Ekle",
                "action" : function (obj) { alert("Ekle"); }
            },
            "Sil" : {
                "label" : "Sil",
                "action" : function (obj) { alert("tiga"); }
            },
            "ccp" : false,
            "create" : false,
            "rename" : false,
            "remove" : false
        }
    }
    

提交回复
热议问题