How can I implement a feature like moving a node in a DNNTree on client side through javascript?
For example, if a parent node has three child nodes 1, 2 and 3 in order, I want to move node 3 to be ahead of node 2 (and of course directly follow the node 1). How can i do that in javascript? For the testing purpose, I can put a button on the page. When I click the button, the node 3 should be moved to be ahead of node 2, all happening on client side in javascript without the page postback. I know there is a javascript function insertBefore, but I couldn't figure out how to make it work. I tried something like
dnn.controls.controls['MyDNNTree'].DOM.childNodes(0).childNodes(0).node.childNodes[0].insertBefore(new dnn.xml.XmlNode(node2), new dnn.xml.XmlNode(node1));
and it won't work. Can somebody help me out here?
I know I can implement adding/deleting nodes on server side. What I want to do is to let user manipulate the nodes (adding/deleting/moving) on client side, and finally postback all the changes to server. I read through the document "DotNetNuke Client API Client Callback.pdf" but don't find the answers.
And besides that, does DNN have the feature to drag and drop a DNNTree node to a new position? If it does, can somebody show me how to do that in some sample codes (again, all on client side in javascript)?
Thanks very much!
Brent