Is there any method to dynamic filter events on client side in fullcalendar?
When I get events from server (json_encoded) I assign my own parameter "school_id" to every event.
After fullcalendar is ready, I want to dynamic filter events with "select".
I add "select" element on page like this:
<select id='school_selector'>
<option value='all'>All schools</option>
<option value='1'>school 1</option>
<option value='2'>school 2</option>
</select>
And in javascript code I add:
jQuery("#school_selector").change(function(){
filter_id = $(this).val();
if (filter_id != 'all') {
var events = $('#mycalendar').fullCalendar( 'clientEvents', function(event) {
if((filter_id == 'all') ) {
return true;
}else{
//what I need to write here to dynamic filter events on calendar?
});
}
});
But it's does not work.
Any help will be great.thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…