Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/399.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript FullCalendar V4中的其他字段和行_Javascript_Jquery_Html_Fullcalendar_Fullcalendar 4 - Fatal编程技术网

Javascript FullCalendar V4中的其他字段和行

Javascript FullCalendar V4中的其他字段和行,javascript,jquery,html,fullcalendar,fullcalendar-4,Javascript,Jquery,Html,Fullcalendar,Fullcalendar 4,我使用的是最新的V4版本的FullCalendar,在我的案例中,我似乎无法添加其他字段,如描述和注释。 我使用daygrid视图,我想再显示两个字段 我尝试了这里的答案(可能是以前的版本)和文档中的多个选项,包括从核心文件夹本身修改main.js,其中定义了titleHtml和timeHtml(如(core.htmlEscape(eventDef.title))。 我设法添加了字段或更好的div,它们出现了,但没有内容,如eventDef.description不是有效的元素,evenDef.

我使用的是最新的V4版本的FullCalendar,在我的案例中,我似乎无法添加其他字段,如描述和注释。 我使用daygrid视图,我想再显示两个字段

我尝试了这里的答案(可能是以前的版本)和文档中的多个选项,包括从核心文件夹本身修改main.js,其中定义了titleHtml和timeHtml(如(core.htmlEscape(eventDef.title))。 我设法添加了字段或更好的div,它们出现了,但没有内容,如eventDef.description不是有效的元素,evenDef.notes也不是

我在哪里可以在eventDef中定义这两个字段,或者如何附加这些字段并显示它们

<script>
  document.addEventListener('DOMContentLoaded', function() {
    var calendarEl = document.getElementById('calendar');
    var start = event.start; 
    var element = this;
    var calendar = new FullCalendar.Calendar(calendarEl, {
    plugins: [ 'dayGrid' ],
    defaultView: 'dayGridWeek',
    displayEventEnd:true,
    columnHeaderFormat:{ weekday: 'long', month: 'long', day: 'numeric', omitCommas: true }, 
    titleFormat: { year: 'numeric', month: 'long' },
    header: {center:  'title,prev,next', right:'', left:''},  
      eventTimeFormat: {
          hour: 'numeric',
          minute: '2-digit',
          meridiem: false
        },
      firstDay:1,
       events: [
        <?php get_data();?>
        ],
    });
    calendar.render(); 
  });

</script>

document.addEventListener('DOMContentLoaded',function(){
var calendarEl=document.getElementById('calendar');
var start=event.start;
var元素=这个;
var calendar=新的完整日历。日历(calendarEl{
插件:['dayGrid'],
defaultView:“dayGridWeek”,
displayEventEnd:true,
ColumnHeadPerformat:{weekday:'long',month:'long',day:'numeric',省略逗号:true},
标题格式:{年:'数字',月:'长'},
标题:{center:'title,prev,next',右:'',左:'},
事件时间格式:{
小时:'数字',
分钟:“两位数”,
梅里迪姆:错
},
第一天:1,
活动:[
],
});
calendar.render();
});
提前感谢您的建议

eventRender: function(info) { 
  info.el.querySelector('.fc-desc').innerHTML = "" + info.event.description + "";
}

多亏了ADyson的帮助,这就解决了我的问题。

你能把你正在尝试的东西弄一弄吗?请一次问一个问题。无论如何,你可以通过eventRender回调向你的事件添加额外的内容-检查文档。你试过了吗?我试过了,但我不想把它作为工具提示,我希望它在默认情况下显示出来,我不能这样做通过使用该回调,甚至删除工具提示部分。您是否有任何工作示例,可能是演示?谢谢。我已经添加了前面提到的fc desc div,然后使用了
eventRender:function(info){info.el.querySelector('.fc desc').innerHTML=“+info.event.description+”;}
,谢谢Adyson!你知道空字符串(
“”
)在这里是完全多余的吗?它们不会向HTML添加任何内容。不清楚为什么要使用它们。
info.el.querySelector('.fc desc')。innerHTML=info.event.description;
将产生完全相同的结果。