How to update jsTree content?

I loaded jsTree with an AJAX call that returns JSON data. How to update a tree so that it updates its contents?

+45
jquery jstree
Sep 10 '10 at 3:16
source share
5 answers

Turning off is as easy as calling:

tree.jstree("refresh"); 
+65
Sep 10 '10 at 3:59
source share

In version 3, you can reload the tree:

 $('#treeId').jstree(true).settings.core.data = newData; $('#treeId').jstree(true).refresh(); 
+42
Nov 19 '14 at 2:05
source share
 var tree = jQuery.jstree._reference("#files"); tree.refresh(); 

or

 var tree = jQuery.jstree._reference("#files"); var currentNode = tree._get_node(null, false); var parentNode = tree._get_parent(currentNode); tree.refresh(parentNode); 
+24
Apr 02 2018-11-11T00:
source share

for jstree3. I use the destroy () function and again create a tree that runs the jstree () function

+9
May 28 '14 at 3:47
source share

$('#treeId').data('jstree', false).empty().jstree(json);

0
Dec 14 '16 at 13:05
source share



All Articles