Move the node
Please use zTree object to executing the method.
JSON data object of the node to be target.
If move the node to root node, please set the 'targetNode' to null.
Please ensure that this data object is an internal node data object in zTree.
JSON data object of the node to be moved.
Please ensure that this data object is an internal node data object in zTree.
Moved to the target node's relative position.
"inner" means: to be taregetNode's child node.
"prev" means: to be taregetNode's previous sibling node.
"next" means: to be taregetNode's next sibling node.
After move the node, whether to automatically expand its parent node.
isSilent = true means: don't expand its parent node.
isSilent = false or omit this parameter means: expand its parent node.
return the node which be moved, it is same as the 'treeNode' parameter.
Return null means: move node has failed. The cause:
1. the targetNode is the treeNode's parent node, and moveType = "inner"
2. the targetNode is the treeNode's child node.
var treeObj = $.fn.zTree.getZTreeObj("tree");
var nodes = treeObj.getNodes();
treeObj.moveNode(nodes[0], nodes[1], "inner");
var treeObj = $.fn.zTree.getZTreeObj("tree");
var nodes = treeObj.getNodes();
treeObj.moveNode(nodes[0], nodes[1], "prev");