Register tree Drag & Drop events with inline XML

Hello,



I am attempting to assign an onDrop event handler to a tree, the tree is implemented using inline XML within the body of the HTML. I have tested the assignment of the event handler by adding a separate piece of code executed via a HTML button onClick method so I know the code works, however I am unable to get the code to execute using the inline definition of the handler.



Code samples:



Code used to initialise the tree:



<div id=“time_profile_library_tree” setImagePath=“images/dhtmlx-imgs/”

    enableDragAndDrop=“true” enableMercyDrag=“true” onDrop=“handleTimeProfileTreeDrag”

            class=“dhtmlxTree” style=“height: 600px; width: 48%; float: left;”>

    

        <item id=“ProfileLibrary” text=“Profile Library” child=“1” open=“true”

            im0=“clock.png” im1=“clock.png” im2=“clock.png”>

            //code add more children

         <%-- time root --%>

    





The code called by the button onClick handler I have used to confirm my JavaScript is working:

time_profile_library_tree.attachEvent(“onDrag”, handleTimeProfileTreeDrag);



The code is being run on Max OS X and has been tested using both Firefox 2.x and Safari 3.1.1 using the pro-version of the libraries, I’m sure it is just something I have overlooked and any pointers will be greatly appreciated.



Thanks

The tree doesn’t map the onDrop attribute to onDrop event handler while initialization, but you can use next workaround


<div id=“time_profile_library_tree” setImagePath=“images/dhtmlx-imgs/”

    enableDragAndDrop=“true” enableMercyDrag=“true” setDropHandler=“handleTimeProfileTreeDrag”


Basically the tree will map any attribute which starts from “enable” or “set” to related tree method.