1
votes

I have created a jsTree from the jsTree plugin, so when a node is clicked, content is loaded to a div at the side. The div that is loaded contains a textarea with the TinyMCE plugin. Everything looks just fine on the first load, but when I click another node, or the same one again, something adds content to the textarea.

This is the string that pops up in the textarea (as HTML because of the TinyMCE plugin)

<p><ins class="jstree-icon">&nbsp;</ins></p>
<p><ins class="jstree-icon">&nbsp;</ins></p>

The next time i reload the content, it adds 2 more, and so on..

Does anyone have any clue of how i can get rid of this?

1
looks like you will need to remove the previous loaded thenThariama
can you show your JS jstree code?Kir
sorry, i am not using jstree with tinymce editor, but i guess that jstree adds the additional html elements to the editorThariama

1 Answers

1
votes

I had the same problem. In my case it helped to give the unique id of all leaves throughout the tree (the subtree)

<ul id="jsTree">
<li id="parent_a">
    <a href="">Name 1</a>
    <ul class="children">
        <li id="unique_id_a_1">...</li>
        <li id="unique_id_a_2">...</li>
        <li id="unique_id_a_n">...</li>
    </ul>
</li>
<li id="parent_b">
    <a href="">Name 2</a>
    <ul class="children">
        <li id="unique_id_b_1">...</li>
        <li id="unique_id_b-2">...</li>
        <li id="unique_id_b_n">...</li>
    </ul>
</li>
</ul>

pzdr