Is there a way to clear out all nodes from a jsTree that's faster than walking through all the nodes deleting them one-by-one?
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.