Fullcalendar,事件文件管理器有时不起作用
在页面上,我有fullcalendar,它决定如何显示现在(所有事件或事件与过滤器),改变变量值的按钮和应用过滤器的功能。
变量(true - 显示所有事件,false - 带过滤器):
var isShownWithCancelEvents = true;
按钮和它的点击功能:
$('.fc-header-left').append('<span class="fc-button fc-button-show-with-canceled-events fc-state-default"><span class="fc-button-inner"><span id="show_without_canceled_events" class="fc-button-content">Show with filter</span><span class="fc-button-effect"><span></span></span></span>');
$(".fc-button-show-with-canceled-events").click(function() {
isShownWithCancelEvents = !isShownWithCancelEvents;
prepareEvents();
});
函数prepareEvents():
function prepareEvents(){
if (isShownWithCancelEvents) {
$('#calendar').fullCalendar('refetchEvents');
$(".fc-button-show-with-canceled-events .fc-button-content ").text("Show with filter");
}
else {
$('#calendar').fullCalendar ( 'removeEvents', filter );
$(".fc-button-show-with-canceled-events .fc-button-content ").text("Show all events");
}
}
过滤功能:
function filter(event) {
return (event.ec_e_id !== null);
}
在fullcalendar中,我使用选项:
viewDisplay: function(view) {
prepareEvents();
},
按钮正在工作,问题与fullcalendar选项。
如果我将警报添加到fullcalendar选项
viewDisplay: function(view) {
alert("something");
prepareEvents();
},
一切正常,并且过滤器每次都能正常工作。
链接地址: http://www.djcxy.com/p/81247.html