attachEvent

attaches the handler to an inner event of dhtmlxGantt

string attachEvent(GanttEventName name,function handler);

Parameters

nameGanttEventNamethe event's name, case-insensitive
handlerfunctionthe handler function

Returns

stringthe id of the attached event handler

Example

gantt.attachEvent("onTaskClick", function(id, e) {
    alert("You've just clicked an item with id="+id);
});

Related samples

Details

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.

See also
Back to top