0

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.

flau
  • 1,328
  • 1
  • 20
  • 36
tomas
  • 121
  • 1
  • 2
  • 11

1 Answers1

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'.

tomas
  • 121
  • 1
  • 2
  • 11