跳转到主要内容

筛选事件

对于任何指定的视图,您可以设置一个过滤函数,该函数将定义在 Scheduler 中应显示哪些事件以及哪些不应显示。

scheduler.filter_week = (id, event) => {
if (event.name === 'New event') {
return false; // 该事件将被过滤(不会渲染)
}

return true; // 该事件将被渲染
};

在此,"week"scheduler.filter_week 中视图的名称。

filter_(viewName) 方法接收两个参数:

  • id - 事件的 id
  • event - 事件对象

请记住,您可以为不同的视图设置不同的过滤函数:

scheduler.filter_day = scheduler.filter_week = (id, event) => {
// some code
};
...
scheduler.filter_timeline = (id, event) => {
// some other code
};

相关示例

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.