如何在 php 中使用具有动态 json 的 bootstrap 树视图

how to use bootstrap treeview with dynamic json in php

   var treeJSON = '';
    function getTreeJSON() {
        $.ajax({
            type: 'POST',
            url: 'controller.php',
            async: false,
            data: {
                param: "FunctionCore->FunctionCoreImpl->getTreeJSON()"
            },
            dataType: 'json',
            success: function (JSON) {
                treeJSON = JSON;
            }
        });
    }
    tree.treeview({
        levels: 1,
        color: "#428bca",
        data: treeJSON});

我可以从页面中获取 json,但是 bootstrap-treeview 不起作用 首先,我想在 bootstrap-treeview 中使用动态 json。 其次,我不想刷新页面。 我能做什么?

我从 得到了答复。 我发现我不需要动态 json,我只需要重新加载 bootstrap-treeview。