本页列出了链接对象可以拥有的所有属性。
如需了解任务对象属性的完整概述,请参阅 Task Properties 文章。
名称 | 类型 | 描述 |
---|---|---|
id | string | number | 链接的唯一标识符 |
source | string | number | 依赖关系起始任务的id |
target | string | number | 依赖关系结束任务的id |
type | string | 依赖类型。可用选项在 links 对象中定义。默认情况下,这些值为:
|
如果你希望为依赖类型使用不同于默认值('0','1','2')的值,可以通过修改 links 对象中的相关属性进行自定义。例如:
gantt.config.links.start_to_start = "start2start";
请注意,此更改只影响依赖类型的存储方式,不影响其显示方式。
名称 | 类型 | 描述 |
---|---|---|
lag | number | 任务之间的滞后时间 |
readonly | boolean | 将链接标记为只读 |
editable | boolean | 将链接标记为可编辑 |
var data = {
tasks: [
{id:1, text:"Project #1", start_date:"01-04-2020", duration:18},
{id:2, text:"Task #1", start_date:"02-04-2020", duration:8, parent:1},
{id:3, text:"Task #2", start_date:"11-04-2020", duration:8, parent:1}
],
links:[
{id:1, source:1, target:2, type:"1"},
{id:2, source:2, target:3, type:"0"}
]
};
Back to top