Fullcalendar 仅在dayGridMonth中显示说明
我需要使用extendedProps,但当我尝试在timeGridWeek或timeGridDay中显示info.event.extendedProps.description时,它不会(它说“未定义”),只在dayGridMonth中。我已经阅读了文档,但我不知道如何显示这些非标准属性 事件显示正确 (对不起,我的英语很差)Fullcalendar 仅在dayGridMonth中显示说明,fullcalendar,fullcalendar-4,Fullcalendar,Fullcalendar 4,我需要使用extendedProps,但当我尝试在timeGridWeek或timeGridDay中显示info.event.extendedProps.description时,它不会(它说“未定义”),只在dayGridMonth中。我已经阅读了文档,但我不知道如何显示这些非标准属性 事件显示正确 (对不起,我的英语很差) document.addEventListener('DOMContentLoaded',function(){ var calendarEl=document.get
document.addEventListener('DOMContentLoaded',function(){
var calendarEl=document.getElementById('calendar');
var calendar=新的完整日历。日历(calendarEl{
插件:['dayGrid','interaction','bootstrap','timeGrid','rrule'],
高度:'父',
标题:{
左:“上一个,下一个今天”,
中心:'标题',
右图:“timeGridDay、timeGridWeek、dayGridMonth”
},
标题格式:{
年份:'数字',
月:“长”,
日期:“两位数”
},
defaultView:“timeGridWeek”,
主题系统:“引导”,
是的,
是的,
导航链接:是的,
周数:对,
是的,
区域设置:“es”,
minTime:'08:00:00',
maxTime:'22:00:00',
周末:错,
事件顺序:“颜色”,
事件来源:[
“carga_citas.php”,
'carga_sesiones.php'
],
事件单击:函数(信息){
警报(info.event.extendedProps.description);
}
});
calendar.render();
});
感谢您的回复。如果看不到您的事件数据(请使用JSON格式),将很难为您提供帮助。您好,ADyson,谢谢您的回复。我刚刚意识到问题恰恰出现在事件数据中,其中一个eventSources中的“description”字段是错误的。嗨,那么,现在基本上问题已经解决了?是的,问题已经解决了。
<script>
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: [ 'dayGrid', 'interaction', 'bootstrap', 'timeGrid', 'rrule' ],
height: 'parent',
header: {
left: 'prev,next today',
center: 'title',
right: 'timeGridDay,timeGridWeek,dayGridMonth'
},
titleFormat: {
year: 'numeric',
month: 'long',
day: '2-digit'
},
defaultView: 'timeGridWeek',
themeSystem: 'bootstrap',
selectable: true,
editable: true,
navLinks: true,
weekNumbers: true,
nowIndicator: true,
locale: 'es',
minTime: '08:00:00',
maxTime: '22:00:00',
weekends: false,
eventOrder : 'color',
eventSources: [
'carga_citas.php',
'carga_sesiones.php'
],
eventClick: function(info) {
alert(info.event.extendedProps.description);
}
});
calendar.render();
});
</script>