This example was created using an aditional script file, that does all the work behind the scenes,
loaded using:
<script language="javascript" src="dndToFolder/dndToTree.js"></script>
Each of the dragable items was given a unique id (dragItem1, dragItem2, ...etc) and were
made dragable using:
<script language="javascript">
ob_attachDragAndDrop(document.getElementById("dragItem1"));
ob_attachDragAndDrop(document.getElementById("dragItem2"));
ob_attachDragAndDrop(document.getElementById("dragItem3"));
ob_attachDragAndDrop(document.getElementById("dragItem4"));
</script>
When drop is made in one of the treeview's folders, an action can be taken depending on whether it was
a copy or a move. Currently if there was a move, the draged item is removed from page while if there was
a copy, nothing happens. The behavior can be easily changed by modifying the dndToTree.js script file and
changing the content of the functions ob_dnd_handleCopy and ob_dnd_handleMove.
With minor modifications, this script can be used to drag any type of element to any treeview.