I have a file upload element that scans the file names upon change and does something to get a valid treeJSON
variable. When the function detects a change the second time, the treeJSON
variable will update, and I need to update the tree.
I've tried various methods such as refresh()
, destroy()
etc., but I haven't been able to construct a new tree on the same page without reloading the page. Here is a snippet, I've included all the functions and it works. The important part is working with the treeJSON
input.onchange = function (e) {
// do something
};
var treeJSON = someVar;
$("#tree").jstree({
core: {
check_callback: true,
data: treeJSON,
},
});