I'm having trouble implementing the suggestion of checking the supplied point argument and inserting the node. Here's what I've tried:
jQuery("#tree_control").tree( { onDrop: function(target,source,point)
{
var node = jQuery("#tree_control").tree("getNode",target);
if ( point != "append" ) // - if point is 'top' or 'bottom'
{
var node_source = jQuery("#tree_control").tree("find",source.id);
var node_w_data = jQuery("#tree_control").tree("getData",node_source.target);
jQuery("#tree_control").tree("append", {parent:target,data:node_w_data});
return;
}
}});
So when the user drags a source node over to a target node and tries to drop the node just before or just after the target node, I want to append a new node as a child to the target node with the same data as the source node (later, I'll delete the original source node that was moved and dropped in the undesired location).
But when I try this, the new node doesn't appear! I still see the original node moved to undesired location, but my new node isn't present. Any comments or suggestions are appreciated.
Thanks.