如何将关闭按钮添加到Fullcalendar中的事件块

问题描述:

我需要将关闭按钮添加到将从日历中删除它的活动。由于文本字段不接受HTML,因此我无法直接执行此操作。什么是修改事件HTML的最佳方式?

I need to add 'close' button to the event which would remove it from the calendar. As 'text' field doesn't accept HTML, I can't do this directly. What is the best way to modify event HTML ?

从Bootstrap-3添加垃圾桶图标

Adding a trash icon from Bootstrap-3

eventRender: function(event, element) {
   element.html(event.title + '<span class="removeEvent glyphicon glyphicon-trash pull-right" id="Delete"></span>');
}

该事件可以在eventClick中捕获:

The event can be captured in the "eventClick":

eventClick: function(calEvent, jsEvent, view) {
  if (jsEvent.target.id === 'Delete') {
    $("#myModal").modal(); // Maybe show a modal dialog asking the user if he wants to delete the event. 
  }
}