filtering events with clientEvents method on fullCalendar

穿精又带淫゛_ 提交于 2019-12-07 17:20:39

问题


i have a fullCalendar calendar working and now i want to use clientEvents method to filter events like the following:

selecter_provider = "somevalue";
events = $('#calendar').fullCalendar( 'clientEvents', [event.provider == selected_provider]);

But i always get an empty array.

I suppose i'm not using the method properly, but i cannot find the way. Any clues?


回答1:


You can use filter as function like from clientEvents DOCs

idOrFilter may also be a filter function that accepts one Event Object argument and returns true if it should be included in the result set.

Code

var selecter_provider = "somevalue";
var events = $('#calendar').fullCalendar('clientEvents', function(evt) {
    return evt.provider == selecter_provider;
});


来源:https://stackoverflow.com/questions/27040984/filtering-events-with-clientevents-method-on-fullcalendar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!