onLightboxDelete

fires when the user clicks on the 'Delete' button in the lightbox

boolean onLightboxDelete(string|number id);
idstring|numberthe task id (the task opened in the lightbox)
booleandefines whether the default action of the event will be triggered (true) or canceled (false)

Example

gantt.attachEvent("onLightboxDelete", function(id){
    const task = gantt.getTask(id);
    if (task.duration > 60){
        alert("The duration is too long. Please, try again");
        return false;
    }
    return true;
})

Details

The event is blockable. Return false to cancel the 'delete' operation and keep the lightbox open.

See also
Back to top