Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Jan 22, 2008 07:46
open dhtmlx forum
How do I attach an event to a tree initialized from inline XML?

How can I attach an event (say onDblClick) to a tree initialized as follows:

    <div id="treeboxbox_tree2" setImagePath="../codebase/imgs/" class="dhtmlxTree" >
    <xmp>
        <item text="Root" open="1" id="11">
            <item text="Child1" select="1" open="1" id="12">
                <item text="Child1-1" id="13"/>
            </item>
            <item text="Child2" id="14"/>
            <item id="15" text="Text"/>
        </item>
    < /xmp>
    </div>
Answer posted by Support on Jan 23, 2008 03:40
It can be done as
<div id="treeboxbox_tree2" setImagePath="../codebase/imgs/" class="dhtmlxTree" setOnDblClickHandler="myFunc" >
....
<script>
function myFunc(id){
    ...
};