jsTree does not retain node selection after Refresh Event

3.6k views Asked by At

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");
}
1

There are 1 answers

0
Martin On BEST ANSWER

I have edit your fiddle. Ist this what you want??

Fiddle

$(function () {
$('#jstree').jstree({plugins: ["state"]});
});


function refresh(){
$("#jstree").jstree("refresh");
}