请查阅每个视图的链接,了解其支持的模板。
可以通过两种方式设置模板:通过代码或使用 HTML 标记。
默认情况下,模板被定义为 JavaScript 函数,该函数接收事件对象或日期参数,并返回一个 HTML 字符串插入到布局中:
scheduler.templates.event_text=function(start, end, event){
return "<a href='http://some.com/details.php?for="+event.id+"'>"
+event.text+"</a>";
}
另一种方式是使用 HTML 声明式地定义模板。此方法需要在页面中引入 html_templates 扩展。启用该扩展后,可以像这样指定模板:
<div class="template:event_text">
<a href='http://some.com/details.php?for={event.id}'>{event.text}<a>
</div>
完整的模板列表可在 API 文档 中查阅。
返回顶部