by stefan_i » Tue Aug 07, 2007 4:36 pm
It may be an old post but anyway here is my solution, unfortunately it's incomplete :
1. I copied the initTree() as a new addNode(obj) function;
2.I removed the loop (through menuItems);
3. menuItems[no] is now obj, the param of the function;
4. I removed the code from initExpandedNodes = ... to the end of the function;
obj is the new node, added with something like : ul.innerHTML = ul.innerHTML + '<li id="node$number"><a href="#">$name</a></li>';
where ul is the parent;
The node was added fine, it had the contexMenu, but the siblings from the same branch lost the contextMenu + expand/collapse capability, while all the other nodes of the tree work correctly.
That's why this solution is incomplete.