The jsTree when refreshed does not retain the previous selected Node. When the jsTree is opened and a node is the selected, then on refresh, the jsTree is closed. This is the jsFiddle Example
I had tried with event binding but does not seem to work. Please let me know of a work around.
JS:
$(function () {
$('#jstree').jstree();
});
function refresh(){
$("#jstree").jstree("refresh");
}
I have edit your fiddle. Ist this what you want??
$(function () {
$('#jstree').jstree({plugins: ["state"]});
});
function refresh(){
$("#jstree").jstree("refresh");
}