Hi all,
I have created a tree in Apex 5 which allows me to change the hierarchy of the nodes by simple drag&drop.
To get the Drag&Drop functionality I have found some really helpful hints in the forum.
I have managed to show an alert after changing the order, The alert shows the name of the employee that is moved, the name of the node where the employee is dragged to and the type of movement (inside, before, after).
So I ended up with this in the execute when page loads section:
var regTree = apex.jQuery("#tree_reg").find("div.tree");
- regTree.tree({
callback : {
onmove: function(NODE, TREE_OBJ, REF_NODE, TYPE)
{alert(NODE.id+" "+TREE_OBJ.id+" "+ REF_NODE);}
}
});
The rest of my Tree is based on the following example:
http://jastraub.blogspot.de/2010/09/adding-context-menu-to-tree-region.html
The Drag&Drop function works but I have some issues saving the new order in the database.
For example if an employee is moved to a new supervisor.

But I honestly have no idea how to use the tree region for updating any database values.
It does not have to be sophisticated. Either a Button which updates the complete tree order in the DB or a direct save/update after dropping the node would do the job just fine
Any ideas to achieve this is appreciated.
Thanks in advance!