attaches the handler to an inner event of dhtmlxGantt
name | string | the event's name, case-insensitive |
handler | function | the handler function |
settings | HandlerSettings | optional, an object with settings for the event handler |
string | the id of the attached event handler |
gantt.attachEvent("onTaskClick", function(id, e) {
alert("You've just clicked an item with id="+id);
});
You can attach several handlers to the same event and all of them will be executed. If some of handlers will return false - the related operation will be blocked. Event handlers are processed in the same order that they were attached.
The settings object can contain the following properties:
gantt.attachEvent("onTaskClick", function(){
console.log("task click");
}, {id: "my-click"}); ... //after a while:
gantt.detachEvent("my-click");
gantt.attachEvent("onTaskClick", function(){
console.log("capture next task click");
return true;
}, {once: true});
this
object for the listener.gantt.attachEvent("onTaskClick", function(){
// ...
return true;
}, {thisObject: this});