2017-07-19 2 views
1

FullCalendar jQuery pluginを使用していて、カスタムボタンをクリックして別のソースからイベントをロードしようとしています。別のイベントソースからのデータをjQuery FullCalendarに再ロードするには?

カレンダーはFIRST_REQUEST URLから返された結果で正しく初期化されますが、カスタムボタンをクリックすると、カレンダーにSECOND_REQUEST URLのjsonデータがリロードされません。事前に

$('#calendar').fullCalendar({ 
    'locale'  : 'fr', 
    'customButtons' : { 
     myCustomButton: { 
      text: global.labelAllEvents, 
      click: function() { 
       $('#calendar').fullCalendar('refetchEventSources', { 
        url: '../url/SECOND_REQUEST' 
       }); 
      } 
     } 
    }, 
    'header' : { 
     left: 'prev,next today myCustomButton', 
     center: 'title', 
     right: 'month,agendaWeek,agendaDay,listMonth' 
    }, 
    'defaultView' : window.mobilecheck() ? "basicDay" : "month", 
    'firstDay'  : 1, 
    'eventLimit' : true, 
    'events'  : '../url/FIRST_REQUEST?code='+parent.codeLiveroom , 
    'eventColor' : 'lightBlue', 
    'eventTextColor': 'black', 
    'editable'  : true, 
    'selectable' : true, 
    'longPressDelay': 500, 
    'timeFormat' : 'H:mm' 
}); 

ありがとう:

は、ここに私のコードです。

レミ

答えて

1

そうかもしれませんか?

var events = { 
     url: "../url/SECOND_REQUEST", 
     type: 'POST', 
     data: {} 
    } 

    $('#calendar').fullCalendar('removeEventSource', events); 
    $('#calendar').fullCalendar('addEventSource', events);   
    $('#calendar').fullCalendar('refetchEvents'); 
+2

ありがとう@ MVG1984 – rem

関連する問題