小编Car*_*nin的帖子

加载 2 个 JSON 事件源的不稳定行为(一个必须是后台事件)

当我加载两个事件时,我收到了一个不稳定的事件行为,eventSources其中一个被定义为渲染:背景。

生成的 JSON 是正确的,因为在eventSources使用正常渲染定义两者时,一切正常。

指示的行为包括以下症状:

  • 一些未呈现的事件(它们总是从不是背景的日历消失,也不会出现在 DOM 中)

  • 显示为正常事件的后台事件

  • 在每次按下上一个/下一个时,行为可能会有所不同。

这是我加载事件的代码:

$('#workshifts_ocupations_calendar').fullCalendar({
  defaultView: 'agendaWeek',
  eventSources: [
    {
      id: "workshiftSource", 
      url: '<?= base_url(); ?>turno/ajax_load_workshifts_by_installation/'+installation,
      editable:true,
      success: function(){
        console.log("turnos");
      }
    },
    {
      id: "backSource",
      url: '<?= base_url(); ?>ocupacion/ajax_load_ocupations_by_installation/'+installation,
      rendering: 'background',
      editable:false,
      success: function(){
        console.log("fondos");
      }
    }
  ],
  eventRender: function(event, element) {
    // Si es background - Mostramos el título.
    if(event.source.rendering == "background"){
      element.html('<span class="backgroundEventsTitle">' + event.title + "</span>");
    }
  },
  locale: 'es', …
Run Code Online (Sandbox Code Playgroud)

javascript json fullcalendar

5
推荐指数
1
解决办法
61
查看次数

标签 统计

fullcalendar ×1

javascript ×1

json ×1