Lightbox 作为用于更新任务详情的编辑表单。
下方展示了默认的 lightbox 布局。
Lightbox 可以根据任务类型及其特定特性有所不同。每种任务类型的配置设置位于 lightbox 对象中,包括:
你也可以添加自定义类型,并相应地定义 lightbox 结构。 更多详细信息请参见 任务类型。
整体的类型结构如下:
自 v7.1.13 起,如果 gantt.config.csp 被设置为 true 或 Gantt 运行在 Salesforce 环境下,lightbox 将会渲染在 Gantt 容器内部。
lightbox 的布局由 lightbox 对象中的 sections 属性定义:
// 默认 lightbox 定义
gantt.config.lightbox.sections=[
{name:"description", height:70, map_to:"text", type:"textarea", focus:true},
{name:"time", height:72, map_to:"auto", type:"duration"}
];
sections 数组中的每一项都代表 lightbox 的一个区块,通过对象及其可用属性进行描述。
lightbox 中的每个区块都基于特定的控件类型构建。可用的控件如下:
var opts = [
{ key: 1, label: 'High' },
{ key: 2, label: 'Normal' },
{ key: 3, label: 'Low' }
];
gantt.config.lightbox.sections = [
{name:"description", height:38, map_to:"text", type:"textarea", focus:true},
{name:"priority", height:22, map_to:"priority", type:"select", options:opts},
{name:"time", height:72, map_to:"auto", type:"duration"}
];
Back to top