跳到主要内容

getTaskByIndex

Description

根据全局任务索引返回对应的任务

getTaskByIndex: (index: number | string) => Task

Parameters

  • index - (required) number | string - 任务在整体任务列表中的位置(从零开始)

Returns

  • task - (Task) - 对应指定索引的任务对象

Example

const globalTaskIndex = gantt.getGlobalTaskIndex(19); // -> 10

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