jsTree load children by ajax

后端 未结 3 1141
一整个雨季
一整个雨季 2021-02-19 23:27

Code posted below loads root elements for my tree by ajax request. My tree is very large so I can\'t load all items at once so I need to load elements by requesting children f

3条回答
  •  日久生厌
    2021-02-20 00:15

     $('#jstree_demo_div').jstree({
                "plugins" : ["wholerow", "checkbox"],
                'core' : {
                    'data' : {
                        'url' : "/" + site + "/places/api/tree/list/",
                        'data' : function(node) {
                            return {
                                'id' : node.id
                            };
                        }
                    },
                }
            })
    

    The solution to my problem is that if I want to return children by ajax request I need to return json file which contains:

    "children:" true
    

提交回复
热议问题