JSTree将另一个json onclick加载到父目录

问题描述

我想在jstree中加载另一个json文件,当我单击父目录时,应该使用jstree加载子目录json文件。这是我的代码

enter image description here

 $("#tree-container").jstree({
    "plugins": ["themes","json_data","dnd","wholerow"],'core' : {
        'data' : {
            url: function (node) {
                console.log(node);
                if(node.id === '#'){
                    return "/cocoon/pdms2/resources/json/marcom-directory.json";
                }
                else if(node.id === '4'){
                    return "/cocoon/pdms2/resources/json/sample.json";
                }
            }
        }
    }
});

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)