Multiple attachEvent

Hello,

I use the Gantt with readonly method. I have multiple attachEvent (ontaskclick, onemptyclick and onlinkclick) but I have a problem. When I click on link, the code in onemptyclick and onlinkclick is executed. I want to execute only the onlinkclick…

Any idea ?

Hi,
onEmptyClick triggers for each click that happens not on task element, so it will be called when user clicks a link.
You can inspect target elelent inside a onEmptyClick handler and ignore link clicks there:[code]gantt.attachEvent(“onEmptyClick”, function(e){
var target = e.target || e.srcElement;
while(target ){
if(target.hasAttribute && target.hasAttribute(gantt.config.link_attribute)){
break;
}

	target = target.parentNode;
}

var is_link = !!target;

alert(is_link);

});[/code]