Omit onTaskClick event on particular button

Hi All,

Currently I have attached an event which is “onTaskClick” event to pop up a custom dialog box.
At the mean time, I have added a custom add button for custom adding task flow.
However, as the add button is in the same row as the entire task, it will call onTaskClick if the add button is clicked.

My question is how can I omit the onTaskClick event on the add button? And the add button will trigger another function when click.
Note: I have attached a screenshot for better understanding.

Thanks in advanced!


here is the solution, this require your button has a className “element_classname”

gantt.attachEvent("onTaskClick", function(id, e) {
	var target = e.srcElement ||;
	if (target && target.className.indexOf("element_classname") !== -1) {
		return false;
	} else {
		return true;

this will return “false” to all callbacks that is subscribed to this event