fullcalendar unbind the eventClick method for the clickable icons placed on the events

痴心易碎 提交于 2019-12-11 03:42:38

问题


I am using fullcalendar plugin. I had used the jquery .on() function to make the icons clickable but the issue is when I click on the icons that are placed on the events then the eventClick method of the fullcalendar plugin is also triggerd. I dont want the eventClick method to be triggered when I click on the icons that are placed on the events on the fullcalendar month view. Has someone faced the similar issue? Is there anyway to disable the eventClick method only when the icons on the events are clicked. I tried to use the .unbind() function but still the evenClick method is been triggered along with the .on() function used for making the icons clickable.


回答1:


In click event of your icons in the end you can cancel the propagation of tha event to the DoomTree.

Example: http://api.jquery.com/event.stopImmediatePropagation/

$(".icons").on("click", function(event){
  event.stopImmediatePropagation();
});

Or: http://api.jquery.com/event.stopPropagation/

$(".icons").on("click", function(event){
  event.stopPropagation();
  // do something
});


来源:https://stackoverflow.com/questions/12002468/fullcalendar-unbind-the-eventclick-method-for-the-clickable-icons-placed-on-the

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