我想知道是否有一種方法使用完全日曆來顯示/隱藏基於該事件的className的元素。有沒有辦法切換基於className的事件可視性FullCalendar
確切的情況是我有一個複選框(假設#daytimeEvent),我想切換事件htat有數組類白天的能見度....
我嘗試這樣做,但迄今爲止它似乎完全刪除從日曆事件沒有可能讓他們回來後....
這裏是我當前的代碼:
$('#daytimeEvent').on('change', function(){
if ($(this).is(':checked'))
{
// That part doesn't work
calendar.fullCalendar('renderEvent');
}
else
{
// This seems to destroy the event without having the opportunity to toggle the visibility back after
calendar.fullCalendar('removeEvents', function(event){
return $.inArray('daytime', event.className)
});
}
}
我爬谷歌和它看起來像我我不是唯一有這個問題的人,但我找不到任何人解決方案。你有
有幾個答案在stackoverflow http://stackoverflow.com/a/36851477/5360631,http://stackoverflow.com/a/33635079/5360631使用複選框進行過濾。他們不使用類名稱,但應該很容易地適應這樣做 – smcd