작업이 계층 구조 내에서 얼마나 깊게 중첩되어 있는지 계산합니다.
task | Task | 평가할 작업 객체 |
number | 트리 구조에서 작업의 깊이 수준, 0부터 시작합니다. |
gantt.attachEvent("onTaskCreated", function(task){
var level = gantt.calculateTaskLevel(task),
types = gantt.config.types;
//작업의 중첩 수준에 따라 작업 유형 설정
switch (level){
case 0:
task.type = types.project;
break;
case 1:
task.type = types.subproject;
break;
default:
task.type = types.task;
break;
}
return true;
});