getTaskByIndex

returns a task by its global task index

Task getTaskByIndex(number | string index);
indexnumber | stringthe task index in the tree (zero-based numbering)
Taska task object

Example

const globalTaskIndex = gantt.getGlobalTaskIndex(19); // -> 10
 
const task = gantt.getTaskByIndex(10); 
// -> {id:"19", text:"Task name", type:"project", order:"10", progress:0.4, …}

See also
Back to top