Fullcalendar Rails可拖动/调整大小不起作用

时间:2012-12-15 18:50:05

标签: jquery ruby-on-rails json jquery-ui fullcalendar

我的第一个问题已经解决event not appear 但是出现了另一个问题,我无法拖动和调整大小。

on 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

1 个答案:

答案 0 :(得分:1)

问题解决了

变化

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

//= require jquery.ui.all