I have a div id="result" , which I use to display the results of user actions. I also added text and html. After each user action, this div is overwritten with the new results .
Now I want to display a jsTree instance inside this div . I have jsTree working, which loads beautifully when the page loads, but it doesnβt "t after <div id="tree"></div> inserted into my div result.
I tried the two lines below, but no one worked.
$("#tree").jstree("loaded"); $("#tree").jstree("refresh");
Any idea how to get jsTree to appear after clicking a button ? Please play jsfiddle where you can see one tree, and I want the other to be shown after the button is clicked. I am not a text behind a tree.
It seems to me that I need to reload or refresh the tree after placing the jstree div inside the html.
source share