Skip to main content

onLightboxSave

Description

Fires when the user clicks on the 'Save' button in the lightbox

onLightboxSave: (id: string | number, task: Task, is_new: boolean) => boolean;

Parameters

  • id - (required) string | number - the id of unmodified task. Note, at this stage the lightbox values aren't applied to the task object yet and you can access the initial task using gantt.getTask(id)
  • task - (required) Task - the modified task object
  • is_new - (required) boolean - specifies whether the user opens the lightbox to create a new task (true)
    or update an existing one (false)

Returns

  • result - (boolean) - defines whether the default action of the event will be triggered (true) or canceled (false)

Example

gantt.attachEvent("onLightboxSave", function(id, task, is_new){
//any custom logic here
return true;
})

Details

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