onBeforeLightbox
Description
Fires immediately before the user opens the lightbox (edit form)
onBeforeLightbox: (id: string | number) => boolean;
Parameters
id- (required) string | number - the task id
Returns
result- (boolean) - defines 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.