Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ram Chander Singh on Feb 14, 2009 03:46
open dhtmlx forum
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
Answer posted by Alex (support) on Feb 16, 2009 02:45

Hello, 

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

function tonclick(id){

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

}

Answer posted by Ram Singh on Feb 16, 2009 08:02
Thank you for your support.

Regards,
Ram