constraint_types

contains all available constraint types

object constraint_types;

Available only in PRO Edition

Related samples

Details

This functionality is available in the PRO edition only.

The object definition:

  • ASAP - (string) - As Soon As Possible
  • ALAP - (string) - As Late As Possible
  • SNET - (string) - Start No Earlier Than
  • SNLT - (string) - Start No Later Than
  • FNET - (string) - Finish No Earlier Than
  • FNLT - (string) - Finish No Later Than
  • MSO - (string) - Must Start On
  • MFO - (string) - Must Finish On
gantt.config.constraint_types = {
 // As Soon As Possible
 ASAP: "asap",
 // As Late As Possible
 ALAP: "alap",
 // Start No Earlier Than
 SNET: "snet",
 // Start No Later Than
 SNLT: "snlt",
 // Finish No Earlier Than
 FNET: "fnet",
 // Finish No Later Than
 FNLT: "fnlt",
 // Must Start On
 MSO: "mso",
 // Must Finish On
 MFO: "mfo"
};

It is added in order to avoid hardcoding constraint values in code:

gantt.addTaskLayer(function draw_deadline(task) {
    var constraintType = gantt.getConstraintType(task);
    var types = gantt.config.constraint_types;
    if (constraintType != types.ASAP && 
        constraintType != types.ALAP && task.constraint_date) {
        // display something
    }
    return false;
});
See also
Back to top