fullcalendar.io在一个Feed中有多个事件源

时间:2017-10-25 09:22:54

标签: javascript fullcalendar

在fullcalendar中,可以定义多个Feed

    $('#calendar').fullCalendar({

    eventSources: [
        // your event source
        {
            url: '/myfeed1',
            color: 'yellow'
        },
        {
            url: '/myfeed2',
            color: 'red'
        }
    ]
});

是否可以在一个json Feed中定义多个源?

我的目标是这样:

 $('#calendar').fullCalendar({    
         eventSources: '/multiplefeedsineone'
     });

" Multiplefeedsinone"会回来:

{
    events: [
        {
            title: 'EventFromFeed1_1',
            start: '2011-04-04'
        },
        {
            title: 'EventFromFeed1_2',
            start: '2011-05-05'
        }
    ],
    color: 'yellow'
},
{
    events: [
        {
            title: 'EventFromFeed2_1',
            start: '2011-04-04'
        },
        {
            title: 'EventFromFeed2_2',
            start: '2011-05-05'
        }
    ],
    color: 'red'
}

1 个答案:

答案 0 :(得分:1)

如果使用单一来源网址an events object is passed instead of an eventSources object.

int n = h == ann->hidden_layers-1 ? ann->outputs : ann->hidden ;
    int m = ann->hidden ;
    double *delta = calloc(m,sizeof(double));
    cblas_dgemv(CblasColMajor,CblasNoTrans,m,n,1,&ww[1],m,dd,1,0.0,delta,1);
    for(j=0 ;  j < ann->hidden; ++j) {
      *d = *o * (1.0-*o)*delta[j];
      ++d; ++o;

    }
    free(delta);
    }

您可能无法传递$('#calendar').fullCalendar({ events: { url: '/myfeed.php', type: 'POST', data: { custom_param1: 'something', custom_param2: 'somethingelse' }, error: function() { alert('there was an error while fetching events!'); }, color: 'yellow', // a non-ajax option textColor: 'black' // a non-ajax option } }); color个选项,也不会传递给后端聚合多个Feed。你后端的结果应该类似于:

textColor