问题
I can't figure out how to show more details in fullcalendar 4 event. Following this post:
[fullcalendar]Have listMonth display more details than month
I tried this code without success:
eventRender: function( info ) {
if (info.view.type == "timeGridWeek")
{
info.el.find('.fc-title').html('something');
}
},
but i'm getting error : failure to parsing JSON. Do you have any idea, what i'm doing wrong? Thank you.
edit: I figured out that get div with class name fc-title i can get with this code:
eventRender: function(info) {
console.log(info.el.getElementsByClassName("fc-title"));
},
but can't find out how to append div or span or whatever element there.
回答1:
Finally i figured it out:
eventRender: function(info) {
var user = document.createElement('div');
user.innerHTML = info.event.extendedProps.calendarUser;
info.el.lastChild.lastChild.appendChild(user);
}
this will add div to element with className '.fc-title'.
来源:https://stackoverflow.com/questions/55395929/show-more-details-in-event-fullcalendar-4