Delete all nodes in jsTree
$('#tree').jstree("destroy").empty();
This is what worked for me. First destroy jstree elements and associated events, and then empty the div containing jstree.
The simplest way I have found is to simply call .empty
on the div containing the tree.
$('#tree').empty();
You might choose to use a more specific selector as a parameter for empty()
, but this works fine for me.