How can I refresh the contents of a jsTree?

前端 未结 5 1667
心在旅途
心在旅途 2020-12-29 00:55

I have loaded a jsTree with an AJAX call that returns JSON data. How can I refresh the tree so that it reloads its contents?

5条回答
  •  长情又很酷
    2020-12-29 01:44

    At version 3 you can reload the tree :

    $('#treeId').jstree(true).settings.core.data = newData;
    $('#treeId').jstree(true).refresh();
    

提交回复
热议问题