Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by gmil on Jan 20, 2009 02:11
open dhtmlx forum
dhtmlxtree: How Can I cancel the default action of onClick event?

Hello,

I want to update the contents inside an update panel (asp.net). I want the postback to occur after the user has clicked a node of the tree:

function OnNodeClick(itemid)
{
// mycode goes here
return false; <-- does this work?
}

tree.attachEvent("onClick",onNodeClick);

MY problem is that after the execution of OnNodeClick, the tree asks the server for the child items xml! I want to cancel that. I want to load the child items when I expand the node.

thank you
Answer posted by Support on Jan 20, 2009 06:11
"onClick" event in tree is not blockable, so returning false from it will not cause any effect. 
But in normal situation just a selection of item ( single click ) will not cause loading of sub-items, it may be triggered by expanding branch or by double-clicking on item.
Please be sure that you are not using any custom code which may trigger item expanding on click