跳转到主要内容

模板(Template)

一个用于容纳部分 HTML 内容的容器。

template_editor

scheduler.locale.labels.section_template = 'Details';// 设置该区域的名称

scheduler.config.lightbox.sections = [
{ name:"text", height:50, map_to:"text", type:"textarea", focus:true},
{ name:"template", height: 40, type:"template", map_to:"my_template"},
{ name:"time", height:72, type:"time", map_to:"auto"}
];
scheduler.attachEvent("onEventCreated", function(id, e) {
var ev = scheduler.getEvent(id);
ev.my_template = "<b>Holder:</b>"+ ev.holder+"

<b>Room:</b>"+ ev.room;
});

初始化

要在 lightbox 中包含 Template 控件,需要执行以下步骤:

  1. 在 lightbox 配置中添加该区域:
scheduler.config.lightbox.sections = [
{ name:"text", ... },
{ name:"template", height: 40, type:"template", map_to:"my_template"},
{ name:"time", ...}
];
  1. 为该区域定义标签:
scheduler.locale.labels.section_template = 'Details';
  1. 通过事件为控件提供内容,例如 onBeforeLightbox 事件:
scheduler.attachEvent("onBeforeLightbox", function(id) {
var ev = scheduler.getEvent(id);
ev.my_template = "<b>Holder:</b>"+ ev.holder+"

<b>Room:</b>"+ ev.room;
return true;
});

属性

以下是 'template' 控件常用的一些关键属性(完整列表请参见这里):

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.