fires when user creates a new task by pressing '+' button in a grid, and also when the createTask method is called

boolean onTaskCreated(object task){ ... };


taskobjectthe object of the new task


booleandefines whether the default action of the event will be triggered (true) or canceled (false)


gantt.attachEvent("onTaskCreated", function(task){
    //any custom logic here
    return true;


Note, the event fires before the new task is added to the dataset that allows you to cancel saving of this task at all,for example, if the user clicks 'Cancel' button in the lightbox.

The final order of events that fire when you create a task with the createTask method:

  1. onTaskCreated
  2. onBeforeLightbox
  3. onLightbox
  4. onAfterLightbox
  5. onAfterTaskAdd
  6. onBeforeTaskAdd
See also
Back to top