types

存储 lightbox 结构的名称(用于不同类型的任务)

object types;

Available only in PRO Edition

Example

var type1 = gantt.config.types.task;


Default value:

types : {task:'task',project:'project',milestone:'milestone', placeholder: "placeholder"}

Related samples

Details

此功能仅在 PRO 版本中可用。

'types' 对象由 “类型编程名称”“类型标识符” 组成:

  • 编程名称主要用于提高代码的可读性,方便操作 types。
  • 类型标识符是保存到数据库中的值,在 types 对象中必须唯一。如果需要,可以将标识符更改为任意值:
    {"task":0,"project":1,"milestone":2}

常见的类型如下:

  • task - (string | number) - 任务类型的标识符。
  • project - (string | number) - 项目类型的标识符。
  • milestone - (string | number) - 里程碑类型的标识符。
  • placeholder - (string | number) - 占位符类型的标识符。
  • [typeName: string] - (string | number | undefined) - 任意自定义类型的标识符。

Gantt 会根据任务类型选择对应的 lightbox:

types: {
    'task':'task',            // 常规任务的 lightbox
    'project':'project',      // 项目任务的 lightbox
    'milestone':'milestone'   // 里程碑的 lightbox
}
See also
  • Articles
  • Back to top