FullCalendar调度程序时间轴无法在rails视图中工作(rails 5.2)

问题描述 投票:0回答:1

这是我在home.html.erb文件中的代码。这些是我正在使用的资产,当我将它作为一个简单的HTML文件运行时,它显示正常,但是当我将它传递给Ruby on Rails html.erb文件时,只有时间轴视图不显示事件。

这是纯HTML中的示例:

Pure HTML

这是rails html.erb中的示例:

html.erb

<%= stylesheet_link_tag('fullcalendar/packages/core/main.min.css') %>
<%= stylesheet_link_tag('fullcalendar/packages/timeline/main.min.css') %>
<%= stylesheet_link_tag('fullcalendar/packages/resource-timeline/main.min.css') %>
<%= stylesheet_link_tag('fullcalendar/packages/bootstrap/main.min.css') %>

<%= javascript_include_tag('fullcalendar/packages/core/main.min.js') %>
<%= javascript_include_tag('fullcalendar/packages/core/main.min.js') %>
<%= javascript_include_tag('fullcalendar/packages/interaction/main.min.js') %>
<%= javascript_include_tag('fullcalendar/packages/resource-timeline/main.min.js') %>
<%= javascript_include_tag('fullcalendar/packages/resource-common/main.min.js') %>
<%= javascript_include_tag('fullcalendar/packages/daygrid/main.min.js') %>
<%= javascript_include_tag('fullcalendar/packages/timegrid/main.min.js') %>
<%= javascript_include_tag('fullcalendar/packages/timeline/main.min.js') %>
<%= javascript_include_tag('fullcalendar/packages/resource-daygrid/main.min.js') %>
<%= javascript_include_tag('fullcalendar/packages/resource-timegrid/main.min.js') %>
<%= javascript_include_tag('fullcalendar/packages/bootstrap/main.min.js') %>

<script>
   document.addEventListener('DOMContentLoaded', function() {
   var calendarEl = document.getElementById('calendar');
   var calendar = new FullCalendar.Calendar(calendarEl, { 
      schedulerLicenseKey: 'XXX-XX-XXX-XXX-XXX',
   plugins: [ 'interaction', 'resourceTimeline', 'resourceDayGrid','resourceTimeGrid', 'bootstrap' ],  

  header: {
    left: 'today prev,next',
    center: 'title',
    right: 'resourceTimelineDay, resourceTimelineTenDay, resourceTimelineMonth, dayGridMonth '
  },
  aspectRatio: 1.5,
  defaultView: 'resourceTimelineDay',
  editable: true,
  selectable: true,

  resources: [
    { id: 'a', servicio: 'BR', title: 'GCV' },
    { id: 'b', servicio: 'BR', title: 'ABC' }

  ],

事件被引用到资源

  events: [
  {
      title: 'CINEPOLIS',
      start: '2019-03-21',
      resourceId: 'a',
      color: 'green'
    },
    {
      title: 'OPERADORA ZIBATA',
      start: '2019-03-21',
      end: '2019-03-10',
      resourceId: 'a'
    },
    {
      title: 'FLEX N GATE',
      start: '2019-03-21T16:00:00',
      end: '2019-03-23T16:00:00',
      resourceId: 'b'
    },
  ]
});

calendar.render();
});

</script>

</head>

日历看起来很好,但是当我看到选项'资源TimelineDay,资源TimelineTenDay,资源TimelineMonth,....时,doest会显示事件。

任何暗示你都可以帮助我。

javascript ruby-on-rails fullcalendar-scheduler
1个回答
0
投票

问题解决了。问题是许可证密钥。

© www.soinside.com 2019 - 2024. All rights reserved.