moveTask

작업을 다른 위치로 이동합니다.

boolean | void moveTask(string | number sid,number tindex, [string | number parent] );
sidstring | number이동할 작업의 식별자
tindexnumber작업이 배치될 대상 위치 인덱스
(브랜치 내의 인덱스)
parentstring | number부모 ID. 제공되는 경우 tindex
'parent' 브랜치 내의 인덱스를 의미합니다.
boolean | voidonBeforeTaskMove에서 이동이 취소되면 `false`를 반환하며, 그렇지 않으면 `undefined`를 반환합니다.

Example

const tasks = {
  data:[
     {id:"p_1", text:"Project #1", start_date:"01-04-2023", duration:18, 
     open:true},
     {id:"t_1", text:"Task #1", start_date:"02-04-2023", duration:8,
     parent:"p_1"},
     {id:"t_2", text:"Task #2", start_date:"11-04-2023", duration:8,
     parent:"p_1"}
   ]
};
gantt.init("gantt_here");
gantt.parse(tasks);
 
gantt.moveTask("t_1", 1); //-> 이 코드는 "t_1" 작업을 루트 레벨로 이동합니다.

See also
Back to top