본문 바로가기

JAVASCRIPT

[jsTree] Context Menu

"plugins" : [ "themes", "xml_data", "ui","crrm","hotkeys","contextmenu"],
"contextmenu" : {
"items" : {
"create" : {
"separator_before" : false,
"separator_after" : true,
"label" : "추가",
"action" : function (obj) { this.create(obj); }
},
"rename" : {
"separator_before" : false,
"separator_after" : true,
"label" : "이름변경",
"action" : function (obj) { this.rename(obj); }
},
"remove" : {
"separator_before" : false,
"separator_after" : true,
"label" : "삭제",
"action" : function (obj) { this.remove(obj); }
},
"ccp" : null
}
}

 

플러그인에 contextmenu라는게 들어가야되고

jstree 자체에서 이전에 클릭했던 tree에 대한 정보를 갖고 있고자 하면

cookie를 plugin에 포함시키면 된다.

 

selected 옵션으로 팝업창 뜨게 해놨는데

이전에 봤던 노드를 자동으로 선택해서 cookie를 빼버렸다.