2010-12-09 51 views

回答

0

你只需要跟蹤一個標誌,是否應該自動刷新。默認情況下它應該是true,但在拖動或調整大小時設置爲false。您可以根據eventDragStart,eventDragStop,eventResizeStarteventResizeStop進行設置。

查看http://arshaw.com/fullcalendar/docs/event_ui/查看與鼠標相關的觸發器列表。

+0

只是我正在尋找的活動,謝謝。 – ericvg 2011-01-24 18:10:34

3

很好的解決...但還不夠:

var calE = { 
     url: 'calendarEvents.do', 
     type: 'POST', 
     data: { 
      siteId: $("#siteId").val() 
     }, 
     error: function() { 
      alert('there was an error while fetching events!'); 
     } 
}; 

function loadCal(){ 
     $('#calendar').fullCalendar({ 
       theme: true, 
       events: calE, 
       editable: false,    
       eventDrop: function(event, delta) { 
         alert(event.title + ' was moved ' + delta + ' days\n' + 
           '(should probably update your database)'); 
       },   
       loading: function(bool) { 
         if (bool) $('#loading').show(); 
         else $('#loading').hide(); 
       }, 
       viewDisplay: function(viewObj) {}   
     }); 

} 

function reloadCalendar(){ 
    $('#calendar').fullCalendar('removeEventSource', calEvent); 
    var source = { 
      url: 'calendarEvents.do', 
      type: 'POST', 
      data: { 
       siteId: $("#siteId").val() 
      }, 
      error: function() { 
       alert('there was an error while fetching events!'); 
      } 
     }; 
    $('#calendar').fullCalendar('removeEvents'); 
    $('#calendar').fullCalendar('addEventSource', source); 
    $('#calendar').fullCalendar('rerenderEvents'); 
    calE = source; 
} 

利用這一點,你會保持原來的算法來獲取數據。