lightbox
Description
指定 lightbox 对象
lightbox: any
Example
scheduler.config.lightbox.sections = [
{ name: "description", height: 50, type: "textarea", map_to: "text", focus: true },
{ name: "location", height: 43, type: "textarea", map_to: "event_location" },
{ name: "time", height: 72, type: "time", map_to: "auto" }
];
...
scheduler.init('scheduler_here', new Date(2027, 2, 1), "week");
Related samples
Details
lightbox 对象包含一个主要属性:
sections- (array) specifies the lightbox sections
//默认定义
scheduler.config.lightbox.sections = [
{ name: "description", height: 200, map_to: "text", type: "textarea", focus: true },
{ name: "time", height: 72, type: "time", map_to: "auto" }
];
Each object in the sections array can have the following properties:
| name | (string) 区段的名称(根据这个名称,调度器将从 locale.labels 集合中获取该区段的标签)。例如,对于 'time' 区段,调度器将获取存储为 scheduler.locale.labels.section_time 的标签。 |
| height | (number) 区段的高度 |
| map_to | ('auto' or string) 将映射到该区段的数据属性名称(见下方详情) |
| type | (textarea,time,select,template,multiselect,radio,checkbox,combo) 区段控件(编辑器)类型 |
| time_format | (string) 设置 'Time Period' 区段中日期时间控件的顺序 |
| focus | (boolean) 如果设置为 true,打开 lightbox 时该区段将获得焦点 |
| default_value | (any) 该区段控件的默认值 |
| onchange | (function) 指定该区段控件的 'onChange' 事件处 理函数(仅适用于 'select' 控件) |
| options | (array of objects) 定义控件的选项(适用于 'select', 'multiselect', 'radio', 'combo' 控件)。数组中的每个对象定义一个选项,并包含以下属性:
|
| vertical | (boolean) 指定单选按钮应垂直排列(true)还是水平排列(false) 仅适用于 'select' 控件 |
| checked_value | (boolean) 勾选状态下复选框的值。可选。默认值为 true(仅适用于 'checkbox' 控件) |
| unchecked_value | (boolean) 未勾选状态下复选框的值。可选。默认值为 false(仅适用于 'checkbox' 控件) |
'map_to:"auto"' 是什么意思?
当 map_to 属性设置为 auto 时:
- 控件本身不返回值,而是通过
set_value()方法直接更新事件的属性(详见 Custom Lightbox Control)。 - 通常用于同时处理多个事件属性的复杂控件。
Related Guides
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.