在事件fullcalendar 4中显示更多详细信息

我无法弄清楚如何在fullcalendar 4事件中显示更多细节。 在这篇文章之后:</ p>


[fullcalendar]让listMonth显示比月更多的细节 </ p>
</ blockquote>

我试过这段代码没有成功:</ p>

  eventRender:function(info){
if(info.view.type ==“timeGridWeek”)
{
info.el.find('。fc-title')。html ('某事');
}
},
</ code> </ pre>

但我收到错误:无法解析JSON。 你知道吗,我做错了什么? 谢谢。</ p>

编辑:
我发现得到类名为fc-title的div我可以使用这段代码:</ p>

   eventRender:function(info){
console.log(info.el.getElementsByClassName(“fc-title”));
},
</ code> </ pre>

但是可以 找不到如何追加div或span或其他任何元素。</ p>
</ div>

展开原文

原文

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.

php

1个回答



最后我想出来了:</ p>

  eventRender:function(info){\  n var user = document.createElement('div'); 
user.innerHTML = info.event.extendedProps.calendarUser;
info.el.lastChild.lastChild.appendChild(user);
}
</ code > </ pre>

这会将div添加到带有className'.fc-title'的元素。</ p>
</ div>

展开原文

原文

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

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐