jquery fullcalendar send custom parameter and refresh calendar with JSON

前端 未结 11 1417
名媛妹妹
名媛妹妹 2020-12-23 12:14

im trying to use the jquery fullcalendar. The event data comes from the server using JSON. My page has a dropdown element and the fullcalendar div.

What i need is to

11条回答
  •  感动是毒
    2020-12-23 12:34

    I just ran into this myself and there is a more dynamic way of doing this since the value is stored when the calendar is initialized and the data object needs modified.

     $(document).ready(function() {
            $('#calendar').fullCalendar({
                events: {
                    url : '/myfeed',
                    data : {personId : $('#personDropDown').val() }
                }
            });
    
            $('#personDropDown').change(function(){
                $('#calendar').data('fullCalendar').options.events.data.personId = $(this).val();
                $('#calendar').fullCalendar('refetchEvents');
            });
    
        });
    

提交回复
热议问题