就像在月我只是想显示图像和在周视图和日视图我想显示事件的完整描述。我已经完成了月视图,我有不同的数据,但不知道如何在该视图中调用事件数据。我尝试了viewDisplay,但不知道如何调用我的事件在这里。
events: function(start, end, callback) {
var currentview = $('#calendar').fullCalendar('getView'); //alert('event called');
if(currentview.name == 'month')
{
var events = <?php echo "[".$json."]"; ?> // this is where we call the php variable
}
else
{
var events = <?php echo "[".$weekjson."]"; ?>
}
callback(events);
}
这段代码是完美的,但它不是每次调用当我的视图改变。
我得到了如何在不同的视图中再次调用事件的解决方案。
在viewDisplay中,我调用了函数for refetchEvents,它用于召回事件。
viewDisplay: function(view) {
refreshEvents(view);
},
函数refreshEvents(视图){
$("#日历").fullCalendar("refetchEvents");
}