I am using FullCalendar3.5.1 Everything working correctly except when there are more than one event for the day (they comes dynamically through JSON), it just display +N more.The examples I have seen it should display atleast one event title and then say +(N-1) more. But for me, even if there are 2 events it display none and say +2 more
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultDate: new Date(),
editable: true,
eventBackgroundColor: '#3672BB',
eventLimit: {
'default': false // display all events for other views
},
eventClick: function(calEvent, jsEvent, view) {
if (calEvent.isSvey){
LoadApptPage(calEvent.eventID,'2');
}
else{
LoadApptPage(calEvent.eventID,'1');
}
},
events: [{"aID":"62241-008","start":"10\/11\/2017","eventID":9608,"isSvey":1,"autoschld":0,"missed":0,"title":"62241-008 - "},{"aID":"162215-003","start":"10\/11\/2017","eventID":9606,"isSvey":1,"autoschld":0,"missed":0,"title":"162215-003 - Construction LLC"},{"aID":162738,"start":"10\/24\/2017","eventID":9607,"isSvey":1,"autoschld":1,"missed":0,"title":"162738 - "}],
eventRender: function(event, element) {
//element.find(".fc-title").remove();
element.find(".fc-time").remove();
var pbSveyFlag = event.isSvey ? 2 : 1;
//var new_description = '<a style="color:#FFF;font-Weight:bold;" href="javascript:LoadApptPage(' + event.eventID +',' + pbSveyFlag +')">'
// + event.title + '</a><br/><br/> +'
var new_description =
'<br/><a style="color:#FFF;font-Weight:bold;" href="javascript:LoadFurPage(' + ''' + event.aID + ''' +',' + '''+pbSveyFlag +''' +')">'
+ '<strong>View: </strong>' + '</a>' + ' '
+ generateLink(event.autoschld,event.missed,event.eventID,event.aID)
;
element.append(new_description);
}
});
});
答案 0 :(得分:2)
您的eventLimit
语法不正确。您只需要指定false
,就像这样:
eventLimit: false,
事实上the default is false,所以你可以简单地将它们全部放在一起,它也会一样。
Working JSFiddle。我不得不删除您对generateLink()
的引用,它与当前问题无关。我还删除了您的eventClick
回调,因为它与当前问题无关。
旁注 - 您的start
值不需要转义斜杠。此外,它们不是Moment-ish值(as described in the docs,因此在控制台上生成警告。文档链接到ISO8601维基百科页面,其中显示了几个合适的日期格式示例。如果没有时间,最简单只是使用YYYY-MM-DD:
"start":"2017-10-11",