I want to create programmatically a new node. Then I want to add this before another node as sibling.
This code does not work:
var node = $("#TreeDiv").dynatree("getActiveNode");
var nextSiblingNode = node.getNextSibling();
var childNode = node.addChild({ title: response.title, key: response.unitId }, nextSiblingNode);
What do I wrong?
UPDATE:
Thats the exception I got with the above code:
Unhandled exception at line 4, column 20662 in http://localhost:1726/Scripts/jquery.dynatree.min.js
0x800a139e - runtime error in JavaScript: <beforeNode> must be a child of <this>