简体   繁体   English

在FullCalendar jQuery插件的选定月视图中检查IF NO事件

[英]Checking IF NO Event in the Selected Month View of FullCalendar jQuery Plugin

I'm using full calendar and have it displayed on month view. 我正在使用完整日历并将其显示在月视图中。 I have buttons to toggle between months. 我有按钮在几个月之间切换。

Now, I want to display a message saying "No events scheduled for the month." 现在,我想显示一条消息“没有为本月安排任何活动”。 when there are no event objects for the month. 当这个月没有事件对象时。

I'm thinking the eventAfterAllRender would be the ideal callback to render/unhide this message. 我认为eventAfterAllRender将是渲染/取消隐藏此消息的理想回调。 The only piece remaining is to check when events are being rendered or not. 唯一剩下的部分是检查事件何时被渲染。 How do I check? 我该如何检查?

Any piece of advise or information would be highly appreciated. 任何建议或信息都将受到高度赞赏。

I found a work-around using elements rendered by the calendar. 我找到了使用日历呈现的元素的解决方法。 To any who needs it: 对任何需要它的人:

if ($('.fc-view-month').has('.fc-event').length === 0) {
    showEmptyCalendarMessage();
} else {
    hideEmptyCalendarMessage();
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM