Перейти к основному содержимому

constraint_types

информация

This functionality is available in the PRO edition only.

Description

Содержит все доступные типы ограничений

constraint_types: { ASAP?: string; ALAP?: string; SNET?: string; SNLT?: string; FNET?: string; FNLT?: string; MSO?: string; MFO?: string; }

Details

The object definition:

  • ASAP - (string) - Как можно скорее
  • ALAP - (string) - Как можно позже
  • SNET - (string) - Старт не ранее чем
  • SNLT - (string) - Старт не позже чем
  • FNET - (string) - Финиш не ранее чем
  • FNLT - (string) - Финиш не позже чем
  • MSO - (string) - Должен начинаться в
  • MFO - (string) - Должен заканчиваться в
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;
});
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.