[jQuery] treeview : Problem with toggle events after changing tree with ajax / js dom

[jQuery] treeview : Problem with toggle events after changing tree with ajax / js dom


Hi,
I am using treeview to display a tree which is modified via php
through some ajax requests.
eg. delete node / edit node / add nodes
I have seen in the demo files that there is some js code to add tree
branches.
and they get automatically the on click toggle events.
In my case I replace / delete some parts of the tree through ajax.
But the on click events aren't working (clear because the html code
and events were changed)
Is there a solution to reenable the toggle events for a part of the
tree ?
Because if i add the js code for the whole tree the newly generated
tree nodes react normally, but the old tree nodes have 2 on click
events (toggle close expand on one click).
I get this on one click.
<li id="li42" class="collapsable"> was toggled
<li id="li42" class="expandable"> was toggled