In calendar control after inserting data, I call renderEvent to get recently inserted data. But I have found undefied. #when i refresh browser I get that data but using render I didn't get data.
Here is my code.
$.ajax({
type: "POST",
url: "/Admin/Calendar/SaveBookings",
dataType: "JSON",
data: { title, Description, startDate, EndDate },
success: function (response) {
debugger;
$("#bookingModal").modal("hide");
$("#calendar").fullCalendar("renderEvent", {
title: response.title,
description: response.description,
start: response.startDate,
end: response.endDate,
});
},
error: function (error) {
if (error.responseJSON.errors) {
$("#titleError").html(error.responseJSON.errors.title);
}
},
});
Here you need to make some changes in FullCalendar.
eventsArraywe will push when we want to update the calendar.eventsArray.push(eventData);calendar.refetchEvents();Try below Snippet