Click here to Skip to main content
15,886,773 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
For the first time jstree is loaded but if i callback jstree through js ,then it is not loaded.

What I have tried:

var PGroupdata = JSON.parse(newStr)


      $('#data').jstree({
          'core': {
              'data': PGroupdata
          }
      });


$('#data').jstree(true).select_node('2');
Posted
Updated 3-Sep-19 21:21pm
v3

1 solution

I would say that your jsTree script is loaded after your code. Try to initialize it on the page load:

JavaScript
$(function () { 
      $('#data').jstree({
          'core': {
              'data': PGroupdata
          }
      });
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900