본문으로 건너뛰기

calculateTaskLevel

Description

작업의 중첩 수준을 계산합니다

calculateTaskLevel: (task: Task) => number

Parameters

  • task - (required) Task - 작업의 객체

Returns

  • level - (number) - 트리 계층 구조에서의 작업 레벨(0부터 시작하는 번호 매김)

Example

gantt.attachEvent("onTaskCreated", function(task){
var level = gantt.calculateTaskLevel(task),
types = gantt.config.types;

//작업 수준에 따라 task 유형 할당
switch (level){
case 0:
task.type = types.project;
break;
case 1:
task.type = types.subproject;
break;
default:
task.type = types.task;
break;
}
return true;
});
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.