how to use bootstrap treeview with dynamic json in php

2.5k views Asked by At
   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});

I can get json from the page, but bootstrap-treeview does not work First,i want to use dynamic json in bootstrap-treeview. Second, i don't want to refresh the page. What can i do?

1

There are 1 answers

0
王肖毅 On BEST ANSWER

I got answer from here . I find that i don't need to get dynamic json, i just need to reload bootstrap-treeview.