Skip to main content

onBeforeTaskDisplay

Description

Fires after the tasks have been loaded to the Gantt chart, but before they are displayed

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

Parameters

  • id - (required) string | number - the task id
  • task - (required) Task - the task object

Returns

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

Example

gantt.attachEvent("onBeforeTaskDisplay", function(id, task){
if (task.priority == "high"){
return true;
}
return false;
});

Details

The event is blockable. Returning false will prevent the task from being displayed