fires when a user creates a new task by pressing the'+' button in a grid, or when the createTask method is called
task | Task | the object of a new task |
boolean | returning `false` will cancel the creation of a new task, returning `true` will continue the default processing |
gantt.attachEvent("onTaskCreated", function(task){
task.projectId = 1;
return true;
});
The event fires before a new task is displayed, which allows you to set default values or cancel the creation of a task.
By the time this event is fired, the new task is already available in the datastore via the getTask method.
If the event handler returns false
, the task will be removed from the datastore without firing the onAfterTaskDelete event.
The final order of events that fire when you create a task with the createTask method is: