Failed to set dynamic data in jquery fullcalendar via ajax

can someone tell me how to populate jquery fullcalendar events using ajax.

Fullcalendar does not have the setter method set to set the ajax response (which is a Json object) after loading the calendar object. Is there a way to submit data after loading a calendar item?

In my case, the first time I provide the data in the fullcalendar "event:" property, and it works fine. But when I click next or previous to switch one month to another, I cannot transfer data to this.

Thnx in advance

+5
source share
2 answers

ASP.NET MVC :

$('#calendar').fullCalendar({
            theme: true,
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            events: "/Calendar/GetEvents/"});

:

public JsonResult GetEvents()
    {
        List<DAL.VwMeeting> allMeeting = meetingRepository.GetAll();
        var eventList = from e in allMeeting
                        select new
                        {
                            url=(e.MeetingOccurID).ToString(),
                            title = e.MeetingTitle,
                            start = ConvertToUnixTimestamp((DateTime)e.MeetingOccurStartDate),
                            end = ConvertToUnixTimestamp((DateTime)e.MeetingOccurEndTime),
                            allDay = false
                        };
        return Json(eventList.ToArray());
    }

:

$('#calendar').fullCalendar('refetchEvents');

+1

, Ajax , fullcalendar Ajax :

$('#calendar').fullCalendar({
    events: "/myfeed.php"
});

, . . fullcalendar.

+1

All Articles