attachEvent

attaches the handler to an inner event of dhtmlxScheduler

string attachEvent(SchedulerEventName name,function handler);

Parameters

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

Returns

stringid the id of the attached event handler

Example

scheduler.attachEvent("onEventSave",function(id,ev){
    if (!ev.text) {
        alert("Text must not be empty");
        return false;
    }
    return true;
})

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