如何在Fullcalendar中向事件块添加关闭按钮

Jur*_*ury 2 fullcalendar

我需要在活动中添加"关闭"按钮,将其从日历中删除.由于'text'字段不接受HTML,我无法直接执行此操作.修改事件HTML的最佳方法是什么?

小智 5

从Bootstrap-3添加垃圾桶图标

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

该事件可以在"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. 
  }
}
Run Code Online (Sandbox Code Playgroud)