function call on select of a Node of a Tree

Hello,



Can you please guide me my doubt is for a dhtmlxTree.



- I have created a dhtmlxTree inside a Accordian.

- I have created a tree using XML.

- I want to call a function on a select of child (last element of node),

- i know in API “tree.setOnClickHandler(tonclick);” is given, but this is adding Click event on each node of tree, and i want to call function on a select of task node (last node means - node which doesn’t have any child).



How we can implement in XML in XML we have only option of CALL=‘1’.





looking forward for your response,







Regards,

Ram


Hello,


There is hasChildren method which can be used to check if item has children:


function tonclick(id){


if(!tree.hasChildren(id)) yourFunction(id);


}

Thank you for your support.

Regards,
Ram