jquery fullcalendar send custom parameter and refresh calendar with JSON

前端 未结 11 1376
名媛妹妹
名媛妹妹 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:21

    Finally it worked with the following code:

    $(document).ready(function() {
            loadCalendar();
            $('#siteSelect').change(function(){
                var selectedSite = $('#siteSelect').val();
                var events = {
                      url: '/myfeed2',
                      type: 'POST',
                      data: {
                        siteid: selectedSite
                      }
                }
                $('#calendar').fullCalendar('removeEventSource', events);
                $('#calendar').fullCalendar('addEventSource', events);
            });
    
        });
    

提交回复
热议问题