2013-05-29 52 views
0

我正在使用gem fullcalendar-rails。Rails Fullcalendar IE不會再引發

我使用ajax作爲事件輸入的數據和模態。

活動模式添加新記錄後,我使用fullcalendar refectchevents在日曆上顯示新事件。這適用於每次我除了IE 9

這裏測試瀏覽器的代碼:

$('#calendar').fullCalendar 
    ignoreTimezone: true, 
    editable: true, 
    defaultView: 'month', 
    height: 500, 
    slotMinutes: 30, 
    selectable: true, 
    selectHelper: true, 
    editable: false, 

    select: (start, end, allDay) -> 
     title = $("#title") 
     description = $("#description") 
     hours = $("#hours") 
     workorder = $("#workorder_id") 
     actcode = $("#actcode_id") 
     $("#dialog-form").dialog 
     autoOpen: true 
     height: 500 
     width: 400 
     modal: true 
     buttons: 
      "Create Labor": -> 
      $.create "/events/", 
      event: 
       workorder_id: workorder.val(), 
       actcode_id: actcode.val(), 
       title: title.val(), 
       description: description.val(), 
       hours: hours.val(), 
       starts_at: "" + start, 
       ends_at: "" + end, 
       all_day: allDay, 
       maxsynch: "N", 
       employee_id: $('#calendar').data('employeeid'), 
       overtime: "TRUE" if $("#overtime").is(":checked") 
      $(this).dialog "close" 
      $('#calendar').fullCalendar('refetchEvents') 

UPDATE1

我改變了下面 - 但是,它並沒有解決它。

eventSources: [{ 
    url: '/events', 
    cache: false, 
    }], 

UPDATE2

這工作:

... 
    employee_id: $('#calendar').data('employeeid'), 
    overtime: "TRUE" if $("#overtime").is(":checked") 
complete: -> 
    $('#calendar').fullCalendar('refetchEvents') 

回答

0

我遇到了類似的問題,但我還沒有使用fullcalendar與軌道。

IE緩存數據所以每次調用重新讀取事件時,它都會顯示緩存事件。

我已經使用events_function來獲取事件。 因爲我在ajax請求中設置了cache:false選項來獲取事件。 它適用於我的情況。

+0

感謝您的幫助。你的events_function代碼是什麼樣的? – Reddirt

+0

我正在使用json,這裏是一個來自fullcalendar的引用'_參數被自動插入,以防止瀏覽器緩存結果(更多詳情)。' – Reddirt

+0

我使用了以下工具:'complete: - > $ ( '#calendar')。fullCalendar( 'refetchEvents') – Reddirt