Any event can be assigned by using property equal to event name
layout = new dhtmlXLayoutObject({ parent:"a_tree", onExpand:function(){ alert("I'm clicked"); } });