Show more details in event fullcalendar 4

邮差的信 提交于 2021-02-11 12:10:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!