getConstraintType

返回应用于任务的约束类型

string getConstraintType(Task task);
taskTask任务对象
string约束类型,详见 constraint_types 配置

Available only in PRO Edition

Example

var constraintType = gantt.getConstraintType(task);
var types = gantt.config.constraint_types;
 
if (constraintType != types.ASAP && 
    constraintType != types.ALAP && task.constraint_date) {
    // 该任务很可能有指定的约束日期
}

Details

此功能仅在 PRO 版本中可用。

返回值对应于任务的 constraint_type,如果已设置。

如果未设置 constraint_type,则返回值将基于当前的调度方式——当从项目结束进行调度时,返回 "asap" 或 "alap"。

所有有效的约束类型可在 gantt.config.constraint_types 配置中找到。

See also
Back to top