这是我的日历:
http://leaguemanager.localsportswire.org/caltest.cfm这是JSON URL
http://leaguemanager.localsportswire.org//json.cfm?json_type=view_timeslots&联盟= 125,requesttimeout = 99999, list_type = timeslots& calendar_slots = 1, return_script =/caltest.cfm
脚本如下:
$(document).ready(function(){
var json_url = '/json.cfm?json_type=view_timeslots&league=125&requesttimeout=99999&list_type=timeslots&calendar_slots=1&return_script=#cgi.script_name#';
if ($(window).width() < 514){
var mydefaultview = 'basicDay';
} else {
var mydefaultview = 'month';
}
$('##timeslots').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
ignoreTimezone: true,
allDayDefault:false,
events: json_url,
defaultView: mydefaultview,
windowResize: function(view) {
if ($(window).width() < 514){
$('##timeslots').fullCalendar( 'changeView', 'basicDay' );
} else {
$('##timeslots').fullCalendar( 'changeView', 'month' );
}
},
eventAfterAllRender: function(){
console.log('Event Rendering Complete');
if ($(window).width() < 514){
$('.fc-header-right').hide();
} else {
$('.fc-header-right').show();
}
},
eventRender: function(event,element,view) {
var view_title = view.title;
var event_title = event.start;
var event_title2 = moment(event_title).format('MMMM YYYY');
if(event_title2 !== view_title && view.name == 'month') { return false; }
else{
var idname = 'event' + event.id;
$(element).attr('id', idname).addClass('ttLT').attr('title', event.title);
var mytitle = event.title;
element.qtip({
content: event.description,
style:{classes:'qtip-bootstrap'},
position:{my:'bottom right',at:'top left'}
});
}
},
eventClick: function(event)
{
if (event.url)
{
new BootstrapDialog({
title : '<h3>Manage Timeslot</h3>',
content : $('<div>Loading...</div>').load(event.url),
buttons : [
{
label : 'Cancel',
onclick : function(dialog){dialog.close();}
}
]
}).open();
return false;
}
},
loading: function(bool) {
if (bool) $('##loading').show();
else $('##loading').hide();
}
});
});
对于我的生活,我不明白为什么该死的事件不加载。我可以让它在其他事件中发挥作用,但我看不出这些特定事件与其他事件有什么不同。
我没有意识到fullcalendar在URL字符串中附加了额外的变量。