我添加了jquery完整的日历,它工作正常。但它没有正确呈现自定义字段。
$('.calendar').each(function () {
var calendar = $(this);
calendar.fullCalendar({
header: {
left: 'prev, next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
selectable: true,
selectHelper: true,
editable: false,
displayEventTime: false,
eventLimit: true,
events: [{"id":22,"title":"john","start":"2017-03-30","end":"2017-03-31","color":"green","allDay":true,"last_name":"doe"}],
eventRender: function(event, element) {
element.attr("content",event.last_name)
}
});
})
这里last_name
没有显示在calendar
.但默认字段显示正常。如何在日历中显示last_name?
所以如果有人需要,这是要走的路。在github
问题的帮助下获得了此解决方案。
eventRender: function(event, element) {
element.append(event.last_name);
}
#or wrapping it with html:
eventRender: function(event, element) {
element.append('<span style="color: pink;">' + event.last_name + '</span>');
}