2012-12-15 120 views
3

我的第一個問題已經解決了event not appear 但是出現了另一個問題,我不能拖動和調整大小。Fullcalendar Rails Dragable/Resize not working

上events.js.coffee:

$(document).ready -> 
    $('#calendar').fullCalendar 
    editable: true, 
    header: 
     left: 'prev,next today', 
     center: 'title', 
     right: 'month,agendaWeek,agendaDay' 
    defaultView: 'month', 
    height: 500, 
    slotMinutes: 30, 

    eventSources: [{ 
     url: '/admin/events', 
    }], 

    timeFormat: 'h:mm t{ - h:mm t} ', 
    dragOpacity: "0.5" 

    eventDrop: (event, dayDelta, minuteDelta, allDay, revertFunc) -> 
     updateEvent(event); 

    eventResize: (event, dayDelta, minuteDelta, revertFunc) -> 
     updateEvent(event); 


updateEvent = (the_event) -> 
    $.update "/admin/events/" + the_event.id, 
    event: 
     name: the_event.title, 
     starts_at: "" + the_event.start, 
     ends_at: "" + the_event.end, 
     ket: the_event.description 

瀏覽器控制檯上

Uncaught TypeError: Object [object Object] has no method 'draggable' fullcalendar.js:2676 
draggableDayEvent fullcalendar.js:2676 
bindDaySeg fullcalendar.js:2658 
(anonymous function) fullcalendar.js:1717 
jQuery.event.dispatch jquery.js:3059 
elemData.handle.eventHandle jquery.js:2677 

資產/ JavaScript的/ application.js中

//= require jquery 
//= require jquery_ujs 
//= require dataTables/jquery.dataTables 
//= require dataTables/jquery.dataTables.bootstrap 
//= require redactor-rails 
//= require_tree . 
//= require bootstrap-alert 
//= require bootstrap-dropdown 
//= require jquery.rest 
//= require jquery.ui.slider 
//= require jquery.ui.datepicker 
//= require fullcalendar 
+0

請您發表您的'應用程序/資產/ Java腳本/ application.js'的內容? –

+0

在quetion上完成 – GeekToL

+0

'jquery-ui'已經包含'jquery.ui.slider'和'jquery.ui.datepicker',你是否嘗試從文件系統和application.js中刪除它們並查看它是否有效? –

回答

1

問題解決

變化

//= require jquery.ui.slider 
//= require jquery.ui.datepicker 

//= require jquery.ui.all 
+0

類似的問題,我加了jquery-ui-1.10.3.custom.min。 JS解決這個問題 – Chookoos