指定 lightbox 对象
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(2013,2,1),"week");
lightbox 对象包含一个主要属性:
//默认定义
scheduler.config.lightbox.sections=[
{name:"description", height:200, map_to:"text", type:"textarea" , focus:true},
{name:"time", height:72, type:"time", map_to:"auto"}
]
sections 数组中的每个项可以包含以下属性:
name | (字符串) 部分的名称,scheduler 会通过 locale.labels 集合获取该部分的标签。例如,'time' 部分的标签为 scheduler.locale.labels.section_time。 |
height | (数字) 部分的高度 |
map_to | ('auto' 或字符串) 与该部分关联的数据属性名称(详见下文) |
type | (textarea,time,select,template,multiselect,radio,checkbox,combo) 部分使用的控件类型 |
time_format | (字符串) 定义“时间段”部分中日期和时间控件的排列顺序 |
focus | (布尔值) 如果设置为 true,lightbox 打开时该部分将自动获得焦点 |
default_value | (任意类型) 该部分控件的默认值 |
onchange | (函数) 控件的 'onChange' 事件处理函数(仅适用于 'select' 控件) |
options | (对象数组) 定义类似 'select', 'multiselect', 'radio', 'combo' 控件的选项。 每个对象表示一个选项,包含以下属性:
|
vertical | (布尔值) 决定 radio 按钮是垂直排列 (true) 还是水平排列 (false)(仅适用于 'select' 控件) |
checked_value | (布尔值) 复选框被选中时的值。可选,默认为 true(仅适用于 'checkbox' 控件) |
unchecked_value | (布尔值) 复选框未选中时的值。可选,默认为 false(仅适用于 'checkbox' 控件) |
当 'map_to' 属性设置为 'auto' 时: