returns the total slack of a task

number|object getTotalSlack( [Task | string | number task] );
taskTask | string | numberoptional, the object of a task or its ID
number|objecteither the total slack of a task or, if the task parameter is not specified, an object with key:value pairs where key is the id of a task and value is the total slack of the task

Available only in PRO Edition


var task = gantt.getTask(7);

Related samples


This functionality is available in the PRO edition only.

This method is defined in the critical_path extension, so you need to activate the critical_path plugin using the gantt.plugins method. Read the details in the Critical Path article.

Total slack is a period of time that can be used to increase the duration of a task or move it on the timeline without affecting the time of ending of the whole project.

See also
Back to top