[英]There's a way to refetch fullcalendar in v3?
I don't want to refetch fullcalendar events. 我不想重新获取全日历事件。 I have a ajax which refresh the var date
and I want to refresh the fullcalendar to set new maxDate and minDate to the calendar. 我有一个刷新更新var date
的ajax,并且我想刷新fullcalendar以将新的maxDate和minDate设置为日历。 The way I'm doing the values changes, but the maxDate and minDate of the calendar doesn't work 我执行值的方式发生了变化,但是日历的maxDate和minDate不起作用
let date = {
'maxDate': moment().toDate(),
'minDate': moment().subtract(365, "days").toDate()
};
$('#calendar').fullcalendar({
// [...]
minDate: date['minDate'],
maxDate: date['maxDate'],
// [...]
});
// [...]
$("#input_calendar").on('change', function () {
$.ajax({
url: "{{ route('calendarioOferta.datas') }}",
method: "GET",
data: {
'calendar': $(this).val()
},
success: function (data) {
date = data;
}
});
});
It looks to me like you will need to just set the calendar on your success call. 在我看来,您只需要在成功电话上设置日历即可。 Right now you are just changing the var date
to be set to your data
on success, but nothing is saying to reset the full calendar. 现在,您只是在更改成功var date
时将var date
设置为您的data
,但是并没有说要重置完整日历。
var setFullCalendar = function(dateData) {
$('#calendar').fullcalendar({
// [...]
minDate: dateData['minDate'],
maxDate: dateData['maxDate'],
// [...]
});
}
$("#input_calendar").on('change', function () {
$.ajax({
url: "{{ route('calendarioOferta.datas') }}",
method: "GET",
data: {
'calendar': $(this).val()
},
success: function (data) {
setFullCalendar(data);
}
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.