Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ernesto Espinoza on Oct 07, 2009 09:43
open dhtmlx forum
How to use the onclick event with dhtmlxtree?

Someone show me how to use the onclick event, sorry for my English, I'm Latino ... I did my tree but I need the onclick event, please someone help me with this issue

Thanks
Answer posted by Stanislav (support) on Oct 07, 2009 09:59
Assuming that you have
         tree = new dhtmlXTreeObject(...
You can add the next codeline
         tree.attachEvent("onClick",function(id){
                //code below is called , each time when item clicked in a tree
                alert("Item "+id+"was clicked"); // this can be replaced with any custom code
 
                 return true;
         })

http://www.dhtmlx.com/dhxdocs/doku.php?id=dhtmlxtree:event_onclick