Hi I want to recreate jsTree with ajax call when radioButton "rdbFactTables" is clicked. I am using jQuery and jsTree scripts.
I get right output in cosole when i print "data" parameter, but from some reason tree won't recreate itself. Here are the snipets:
<p><input type="radio" name="rdbFactTables" value="1">fSell</p>
<div class="green pull-left bottom">
<div id="checkboxTree"></div>
</div>
<SCRIPT type="text/javascript">
$( "input[name='rdbFactTables']" ).click(function(){
var idValue = $('input[name=rdbFactTables]:checked').val();
var request = $.ajax({
type: "POST",
url: "/StarReporting/servlets/TreeProcessServlet",
data: { id: idValue}
}).done(function( data ) {
//here i get data data printed in console but tree is not recreated
console.log(data);
$('#checkboxTree').jstree('destroy');
$('#checkboxTree').jstree(data);
});
});
</SCRIPT>