dayrender fullcalendar函数在我的解决方案中不起作用

webghufk  于 2021-09-13  发布在  Java
关注(0)|答案(0)|浏览(319)

我正在使用js fullcalendar。我发现以下代码:

  1. $('#calendar').fullCalendar({
  2. header: {
  3. left: 'prev,next today',
  4. center: 'title',
  5. right: 'month,basicWeek,basicDay'
  6. },
  7. defaultView: 'month',
  8. dayRender: function (date, cell) {
  9. var id = 'checkbox-2-' + (date.getTime() / 1000).toFixed(0);
  10. var exists = selectedDays.indexOf('checkbox-2-' + (date.getTime() / 1000).toFixed(0));
  11. if (exists > -1) {
  12. cell.append('<input id="' + id + '" type="checkbox" class="checkbox" checked/>');
  13. }
  14. else{
  15. cell.append('<input id="' + id + '" type="checkbox" class="checkbox"/>');
  16. }
  17. $('#'+id).change(function() {
  18. if($(this).is(":checked")) {
  19. selectedDays.push($(this).attr('id'));
  20. }
  21. else{
  22. var index = selectedDays.indexOf($(this).attr('id'));
  23. if (index > -1) {
  24. selectedDays.splice(index, 1);
  25. }
  26. }
  27. });
  28. }
  29. });

但是dayrender函数不适用于我,也不显示日历网格,只显示标题(今天、下一个等等)。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题