如何将关闭按钮添加到Fullcalendar中的事件块 [英] How to add close button to the event block in Fullcalendar
本文介绍了如何将关闭按钮添加到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.
}
}
这篇关于如何将关闭按钮添加到Fullcalendar中的事件块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文