Closed benda95280 closed 12 years ago
Hello,
The 'move_info' does not contain information about the original position of the moved node. I think it will be a good idea to add this info in a new version of jqTree.
There is a workaround, however. You can use the 'onCanMove' event to get information about the moved node:
var original_parent = null;
$('#tree1').tree({
data: data,
dragAndDrop: true,
onCanMove: function(node) {
original_parent = node.parent;
return true;
}
});
At this moment it's not possible to add a node dynamically. Perhaps this is nice feature for the new version.
The 'dev' branch does contain a function 'loadData' which can replace all data in the tree.
$('#tree1').tree('loadData', new_data);
The 'dev' branch contains a new feature for loading a subtree. The function 'loadData' now accepts a 'parent_node' parameter.
$tree.tree('loadData', data, parent_node);
The 'tree.move' event now contains the 'previous_parent' property. This is implemented in the 'dev' branch.
Implemented in version 0.7.
Dear Mbraak,
I'm having probleme when i want to move a node (tree.move) : If i try to access (e.move_info.moved_node.parent) i have the parent of (e.move_info.target_node.parent)
How can i do if i want to access to the parent of Moved_node ? ( i want to see if the moved node is root or not )
And can you tell me how i can add a node dynamically ?
Thanks a lot.