fullCalendar eventClick handler does not work if editable false

落爺英雄遲暮 提交于 2019-12-10 15:20:22

问题


The jQuery fullCalendar plugin seems to have a problem in the editable mode in certain cases. If the eventClick handler is set and editable is true, than the eventClick function will not work, only the eventDrop function. If editable is set to false, the eventDrop function does not work (as expected), but the eventClick function does. I am not sure where the problem is, is it possible to use the eventClick and eventDrop handler while editable is true? Has someone encountered a similar problem while using the plugin?

$('#calendar').fullCalendar({
  ..
  editable:true,
  eventClick: function(calEvent, jsEvent, view) {
    .. // only called if editable is false (?)
  },
  eventDrop: function(event,dayDelta,minuteDelta,allDay,revertFunc) {
    .. // only called if editable is true (correct)
  }

回答1:


First I thought the jQuery version has something to do with it. Further testing did not confirm this hypothesis. It turns out that the click handler works only if you disable resizing with disableResizing:true, i.e. if editable is true (editable:true) then the click event is only triggered if resizing is disabled (disableResizing:true). Maybe the Resize and Click events influence each other somehow..




回答2:


It seems from the above that using jQuery 1.3.2 was causing this problem and a more recent version of jQuery will fix this issue.




回答3:


I also had the editable: true option and instead I fixed it by installing the jQuery UI modules:

  • Draggable (the Droppable module is not required)
  • Resizable


来源:https://stackoverflow.com/questions/9038062/fullcalendar-eventclick-handler-does-not-work-if-editable-false

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!