跳转到主要内容

年视图

年视图在日历中显示一个或多个年份。

year_view

Year view

初始化

要在调度器中启用年视图,请按照以下步骤操作:

  1. 在页面上激活 Year 扩展:
scheduler.plugins({
year_view: true
});
  1. 在调度器的标记中添加视图的标签(tab):
<div id="scheduler_here" class="dhx_cal_container" ...>
<div class="dhx_cal_navline">
...
<div class="dhx_cal_tab" name="year_tab"></div>
</div>
...
</div>
  1. 为标签设置显示文本:
//'year_tab' 是我们 div 的名称
scheduler.locale.labels.year_tab = "Year";

Year view

界面细节

  • 已分配事件的日期会被高亮显示。
  • 将鼠标悬停在某一天,会显示一个工具提示,列出当天安排的所有事件。点击工具提示中的"details"图标将打开 lightbox(除非启用了只读模式)。

设置视图中的月份数量

要控制每行和每列中显示多少个月份,请调整 year_xyear_y 属性:

//年视图将只显示 6 个月
scheduler.config.year_x = 2; //每行显示 2 个月
scheduler.config.year_y = 3; //每列显示 3 个月

相关指南

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.