Radio
一组单选按钮

注释
请确保启用 editors 扩展,以便在 lightbox 中使用此控件
scheduler.plugins({
editors: true /*!*/
});
var priorities = [
{ key: 1, label: 'High' },
{ key: 2, label: 'Medium' },
{ key: 3, label: 'Low' }
];
scheduler.locale.labels.section_priority = 'Priority';
scheduler.config.lightbox.sections = [
{ name:"text", height:50, map_to:"text", type:"textarea", focus:true },
{ name:"priority", height:58, options:priorities,
map_to:"priority", type:"radio", vertical:true},
{ name:"time", height:72, type:"time", map_to:"auto"}
];
初始化
要在 lightbox 中包含 Radio 控件,请按照以下步骤操作:
- 在页面上启用 'editors' 扩展:
scheduler.plugins({
editors: true
});
- 在 lightbox 配置中添加 radio 区块:
scheduler.config.lightbox.sections = [
{ name:"description", ... },
{ name:"radiobutton", height:58, options:priorities,
map_to:"priority", type:"radio", vertical:true},
{ name:"time", ...}
];
- 定义该区块的标签:
scheduler.locale.labels.section_priority = 'Priority';
属性
以下是 'radio' 控件常用的主要属性(完整列表请参见 这里):
| name | (string) 区块的名称 |
| height | (number) 区块的高度 |
| map_to | (string) 该区块映射到的数据属性名 |
| type | (textarea,time,select,template,multiselect,radio,checkbox,combo) 区块控件的类型 |
| options | (对象数组) 定义控件的选项(用于 'select'、'multiselect'、'radio'、'combo' 控件 |