当我添加新事件或更新事件或更改事件或拖动新时间或新用户时,每次页面刷新时。但如何解决此问题而不重新加载页面并显示更新的事件时间或删除事件。我正在使用日历版本 5 作为 fullcalendar。
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
now: '<?php echo $CurrentDate; ?>',
editable: true,
aspectRatio: 1.8,
scrollTime: '00:00',
timeFormat: 'H(:mm)',
headerToolbar: {
left: 'today prev,next',
center: 'title',
right: 'resourceTimelineDay,timeGridWeek,dayGridMonth'
},
resources: <?php eventGroups(); ?>,
events: function(info, successCallback, failureCallback) {
successCallback(<?php eventGroupsDetails($fromDate,$toDate); ?>)
},
dateClick: function(info) {
$('#addScheduleEntry').modal('show');
$(document).on('click', '.modal_default_ok', function() {
$.ajax({
url: "calendar_event_create.php",
type: "POST",
data: $("#frmEvent").serialize(),
dataType: 'json',
success: function(response){
if(response.result == 'success'){
// how to get updated event and display in calender without page refresh
}
}
});
});
},
eventClick: function(info, jsEvent, view) {
$.ajax({
url: "calendar_event_update.php",
type: "POST",
data: $("#frmEventUpdate").serialize(),
dataType: 'json',
success: function(response){
// how to get updated event and display in calender without page refresh
}
});
},
饮歌长啸