【问题标题】:Show more details in event fullcalendar 4在活动完整日历 4 中显示更多详细信息
【发布时间】:2019-03-28 22:26:14
【问题描述】:

我不知道如何在 fullcalendar 4 事件中显示更多详细信息。在这篇文章之后:

[fullcalendar]Have listMonth display more details than month

我试过这段代码没有成功:

eventRender: function( info ) {
  if (info.view.type == "timeGridWeek")
  {
     info.el.find('.fc-title').html('something');
  }
},

但我收到错误:解析 JSON 失败。你有什么想法,我做错了什么?谢谢。

编辑: 我发现可以使用以下代码获取类名 fc-title 的 div:

eventRender: function(info) {
  console.log(info.el.getElementsByClassName("fc-title"));
},

但不知道如何在其中附加 div 或 span 或任何元素。

【问题讨论】:

    标签: php fullcalendar-4


    【解决方案1】:

    我终于明白了:

    eventRender: function(info) {
      var user = document.createElement('div');
      user.innerHTML = info.event.extendedProps.calendarUser;
      info.el.lastChild.lastChild.appendChild(user);
    }
    

    这会将 div 添加到 className 为 '.fc-title' 的元素。

    【讨论】:

    • 我花了很多时间搜索这个。谢谢你。
    猜你喜欢
    • 2010-12-02
    • 1970-01-01
    • 2020-09-08
    • 1970-01-01
    • 2018-05-06
    • 2020-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多