duanquan1207 2019-07-16 20:51
浏览 127

问题在Fullcalendar中插入模态的代码

I am testing Fullcalendar and it can read events fine from database. Now I am trying to include some code I found for making a modal to insert new events in Fullcalendar. No matter what I do, the calendar stops rendering?

I found a code from JSfiddle that looks really good: https://jsfiddle.net/milz/fotLoLy9/

And here is my code I am using:

  document.addEventListener('DOMContentLoaded', function() {
    var calendarEl = document.getElementById('calendar');

    var calendar = new FullCalendar.Calendar(calendarEl, {
          schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source',
      plugins: [ 'interaction', 'dayGrid', 'timeGrid', 'resourceTimeline' ],
      now: '<?php echo date("Y-m-d"); ?>',
      editable: true,
      aspectRatio: 1.8,
      scrollTime: '00:00',
      header: {
        left: 'today prev,next',
        center: 'title',
        right: 'resourceTimelineDay,resourceTimelineThreeDays,timeGridWeek,dayGridMonth'
      },

      defaultView: 'resourceTimelineDay',
      views: {
        resourceTimelineThreeDays: {
          type: 'resourceTimeline',
          duration: { days: 3 },
          buttonText: '3 days'
        }
      },
      resourceGroupField: 'building',
      resources: [
        { id: 'a', building: 'One', title: 'A' },
        { id: 'b', building: 'One', title: 'B', eventColor: 'green' },
        { id: 'c', building: 'One', title: 'C', eventColor: 'orange' },
        { id: 'e', building: 'One', title: 'D' },
        { id: 'i', building: 'Two', title: 'Extra' }
      ],
      events: 'load.php',

    });

    calendar.render();

  });

I want to combine those two codes, but when I try, the calendar stops rendering. So, there is just a blank page as a result. I dont know how to see error messages? For php, the error log tells me whats wrong. But this isnt showing in error log..

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 树莓派安卓APK系统签名
    • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
    • ¥65 汇编语言除法溢出问题
    • ¥15 Visual Studio问题
    • ¥20 求一个html代码,有偿
    • ¥100 关于使用MATLAB中copularnd函数的问题
    • ¥20 在虚拟机的pycharm上
    • ¥15 jupyterthemes 设置完毕后没有效果
    • ¥15 matlab图像高斯低通滤波
    • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗