Closed AndeYashwanth closed 3 years ago
You could set core.data to a function which returns a variable which you control, and then simply call refresh.
var data = [...];
$("#tree").jstree({ core: { data:function (node, cb) { cb(data); } }});
// some time later
data = [...];
$("#tree").jstree(true).refresh();
Or destroy the instance and create it again: https://www.jstree.com/api/#/?q=destroy&f=destroy()
$("#tree").jstree(true).destroy();
I am creating a folder structure using jstree. The server initially send the "data" array using which I create the jstree.
There are some events generated in my application and I have to rerender the jstree with the new "data" received from the server. But there is no change in the tree, I created a jsfiddle to simulate what I am trying to achieve. https://jsfiddle.net/3t94evdc/
why this doesn't work? Is there any workaround to rerender on the same div?