returns the constraint type applied to the task

string getConstraintType(Task task);
taskTaska task object
stringconstraint type as defined in constraint_types config

Available only in PRO Edition


var constraintType = gantt.getConstraintType(task);
var types = gantt.config.constraint_types;
if (constraintType != types.ASAP && 
    constraintType != types.ALAP && task.constraint_date) {
    // this task probably a constraint date specified


This functionality is available in the PRO edition only.

The return value will match the constraint_type value of the task if it's not empty.

If the constraint_type is empty, the return value will depend on the current scheduling strategy - either "asap" or "alap" if scheduling from the project end is enabled.

All allowed constraint types are defined in the gantt.config.constraint_types config.

See also
Back to top