简体   繁体   English

有没有一种方法可以在v3中重新获得fullcalendar?

[英]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.

相关问题 全日历重新获取事件源 - Fullcalendar refetch eventsource 用RequireJS加载Marionette(v3)的正确方法是什么? - What's the correct way to load Marionette (v3) with RequireJS? Angular 11:如何在 Fullcalendar V5 中重新获取(从后端更改事件时)事件? - Angular 11 : How to refetch (when events are changed from backEnd) Events in Fullcalendar V5? FullCalendar v3-更改视图时更改事件源 - FullCalendar v3 - Change Event Source on View Change FullCalendar V3 更多事件弹出滚动条不起作用 - FullCalendar V3 more events pop over scroll bar not working 根据输入中的值重新获取FullCalendar事件 - Refetch FullCalendar Events Based On Values in Inputs 使上传的图像文件可通过 URL 访问的正确方法是什么 - google drive api v3 - What's the correct way to make the uploaded image file accessible via URL - google drive api v3 在JavaScript中使用fullcalendar,如何修改参数列表并重新获取? - Using fullcalendar with javascript, how to modify a parameters list and refetch? fullcalendar 版本 4:重新获取事件不会删除新添加的事件 - fullcalendar version 4: refetch events doesn't remove newly added event FullCalendar v4 - fullCalendar 不是一个函数 - FullCalendar v4 - fullCalendar is not a function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM