JQuery:FullCalendar插件:事件不会在周视图和日视图中显示,但会在月视图中显示 [英] JQuery:FullCalendar Plugin: Events are not shown in week view and day view but are shown in month view

查看:133
本文介绍了JQuery:FullCalendar插件:事件不会在周视图和日视图中显示,但会在月视图中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码来获取事件:

 
$('#calendar')。fullCalendar({
theme:true,
slotMinutes:10,
header:{
left:'prev,next today',
center:'title',
right:'month,agendaweek,agendaDay',
},
defaultView:'agendaDay',
allDaySlot:false,
editable:false,
events:/cgi-bin/shlk/getshlkruns.pl
});

getshlkruns.pl的输出非常简单json feed:

$ b [{'title':'Successful','start': 1266398223,'end':1266398266,'url':'/shlk/cgi-bin/getshlkrunlog.pl?i=21'}]



<



因此,上述事件在月份视图中显示,但在上午时显示为神秘缺失在周或日视图中。



这里做错了什么?

预先感谢您的回答。 / p>

解决方案

我也遇到过这个问题。修正是为了确保在JSON中返回的每个事件都包含一个allDay名称/值对设置为false。

  [ {'title':'成功','allDay':false,'start':1266398223,'end':1266398266,'url':'/shlk/cgi-bin/getshlkrunlog.pl?i=21'}] 

或者将allDayDefault设置为false:



<$ p $ fullCalendar({
...
allDayDefault:false,
...
}); $ p $ $('#calendar'


I've the following code to fetch events:

$('#calendar').fullCalendar({
theme: true,
slotMinutes: 10,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay',
},
defaultView: 'agendaDay',
allDaySlot: false,
editable: false,
events: "/cgi-bin/shlk/getshlkruns.pl"
});

The output from getshlkruns.pl is fairly simple json feed:

[{'title': 'Successful','start': 1266398223,'end': 1266398266,'url': '/shlk/cgi-bin/getshlkrunlog.pl?i=21'}]

There are several events like above (i've removed for brevity sake).

So the above events show up when am in the month view but mysteriously absent when am in week or day view.

What am doing wrong here?

Thanks in advance for your answers.

解决方案

I ran across this problem too. The fix was to make sure each event returned in the JSON included an "allDay" name/value pair set to false.

[{'title': 'Successful','allDay': false,'start': 1266398223,'end': 1266398266,'url': '/shlk/cgi-bin/getshlkrunlog.pl?i=21'}]

Or set allDayDefault to false:

$('#calendar').fullCalendar({
    ...
allDayDefault: false,
    ...
});

这篇关于JQuery:FullCalendar插件:事件不会在周视图和日视图中显示,但会在月视图中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆