onBeforeLightbox

fires immediately before the user opens the lightbox (edit form)

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

Example

gantt.attachEvent("onBeforeLightbox", function(id) {
    const task = gantt.getTask(id);
    task.my_template = `<span id='title1'>Holders: </span>${task.users}
    <span id='title2'>Progress: </span>${task.progress*100}%`;
    return true;
});

Related samples

Details
  • The event is blockable. Return false to cancel the default processing (opening of the lightbox).
  • Using this event is a good way to customize something in the lightbox.
Back to top