如果可编辑为false,fullCalendar eventClick处理程序不起作用 [英] fullCalendar eventClick handler does not work if editable false

查看:122
本文介绍了如果可编辑为false,fullCalendar eventClick处理程序不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jQuery fullCalendar插件在可编辑模式中在某些方面似乎存在问题案例。如果设置了 eventClick处理程序并且可编辑为true,那么eventClick功能将不起作用,只有eventDrop函数。如果可编辑设置为false,则eventDrop函数不起作用(如预期的那样),但eventClick函数可以。我不确定问题出在哪里,可以在editable为true的情况下使用eventClick和eventDrop处理程序吗?有人在使用插件时遇到类似的问题吗?
$ b


  $('#calendar')。fullCalendar({
..
$ editable:true,
eventClick:function(calEvent,jsEvent,view){
.. //只有当可编辑为false时才会调用(?)
},
eventDrop:函数(事件,dayDelta,minuteDelta,allDay,revertFunc){
.. //仅当可编辑为true时调用(正确)
}



解决方案

首先,我认为jQuery版本与它有关,进一步的测试没有证实这个假设。事实证明,只有当您禁用调整大小与 disableResizing:true ,即如果editable为true( editable:true ),那么点击事件只会在调整大小被禁用时触发( disableResizing:true )也许调整大小和点击事件会以某种方式相互影响。 / p>

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)
  }

解决方案

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..

这篇关于如果可编辑为false,fullCalendar eventClick处理程序不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆