跳转到主要内容

模板

一个包含一些 HTML 内容的容器。

模板编辑器

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) {
const ev = scheduler.getEvent(id);
ev.my_template = "<b>Holder:</b>"+ ev.holder+"

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

初始化

要将 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) {
const 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.