json のファイルから jsTree の contextmenu をロードする必要があります。コンテキスト メニューは、このファイル ("test.json") に保存されます。
{
"item1" : {
"label" : "voce1"
},
"item2" : {
"label" : "voce2"
}
}
コンテキストメニューをロードするコードは次のとおりです。
$(function () {
$("#tree").jstree({
"plugins" : [ "themes", "json_data", "ui", "contextmenu" ],
// other code ....
"contextmenu" : {
"items" : customMenu
}
})
});
function customMenu(node) {
$.getJSON( "test.json", function(json) {
return json;
});
}
このように、コンテキストメニューは表示されません。手伝って頂けますか?