3

我的第一个问题已经解决,事件没有出现 ,但出现了另一个问题,我无法拖动和调整大小。

在 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
4

1 回答 1

1

问题解决了

改变

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

//= require jquery.ui.all
于 2012-12-16T08:17:39.983 回答