How can I refresh the contents of a jsTree? How can I refresh the contents of a jsTree? jquery jquery

How can I refresh the contents of a jsTree?


Turns out is is as simple as calling:

   tree.jstree("refresh");


At version 3 you can reload the tree :

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


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);