问题描述
我正在使用FullCalendar JQuery插件在Web应用程序上工作,以显示公司中每天工作人员的缺席情况。
我需要显示几种类型(或领域)的信息在每一天。例如,我想每天显示:标题(例如约翰不在场)和百分比(例如95%帮助)。我希望这个百分比在每天的框的右下角以不同的格式显示。
据我所见,可能的字段为描述一个事件基本上是这些:
事件:[
{
title:'John生病了',
start:'2013-11-19',
allDay:true
},
{
标题:'Mike正在休假',
start:'2013-11-21',
end:'2013-11-26',
allDay:true
}
]
有没有办法在FullCalendar的日子里添加更多的字段(比如帮助的多少)?
编辑:感谢Henrique C的回答,我设法做到了。我想补充一点,我想补充一点,除了做Henrique在他的回答中所说的话,还需要做这样的事情:
<$ p $ fullCalendar({
events:[
{
title:'My Event',
start:'2010 -01-01',
描述:'这是一个很酷的事件'
}
//更多事件在这里
],
eventRender:function(event,element ){
element.qtip({
content:event.description
});
}
});
这是从Fullcalendar网站获取的。
上面的字段中,您还可以在每个事件对象中包含您自己的非标准字段。 FullCalendar不会修改或删除这些字段。例如,开发人员通常会在回调中包含一个描述字段,例如eventRender。
您可以添加所需字段,fullcalendar不会更改它们。
events:[
{
title:'John is sick',
start:'2013-11 -19',
allDay:true,
description:'Hurrayyyyyyyyyy',
myotherspecialfield:':P'
},
{
title:' Mike正在休假',
开始:'2013-11-21',
结束:'2013-11-26',
allDay:true,
描述:'Hurrayyyyyyyyyy '
myotherspecialfield:':P'
}
]
I am working on a web app using the FullCalendar JQuery plugin to display the absence/presence of workers each day in a company.
I need to display several types (or fields) of information in each day. For example, I would like to display for each day: a Title (ex. "John is absent"), and Percentage(ex, "95% assistance"). And I would like this percentage to appear with a different format, on the bottom right corner of each day's box.
As far as I've seen, the possible fields to describe an event are basically these ones:
events: [
{
title: 'John is sick',
start: '2013-11-19',
allDay: true
},
{
title: 'Mike is on vacation',
start: '2013-11-21',
end: '2013-11-26',
allDay: true
}
]
Is there any way to add more fields (like the porcentage of assistance) to a FullCalendar day?
Edit: thanks to Henrique C's answer I managed to do it. Just to complete a little more the answer I would like to add that besides, doing what Henrique said in his answer, it is also necessary to do something like this:
$('#calendar').fullCalendar({
events: [
{
title: 'My Event',
start: '2010-01-01',
description: 'This is a cool event'
}
// more events here
],
eventRender: function(event, element) {
element.qtip({
content: event.description
});
}
});
Non-standard Fields This was taken from Fullcalendar website.
In addition to the fields above, you may also include your own non-standard fields in each Event Object. FullCalendar will not modify or delete these fields. For example, developers often include a description field for use in callbacks such as eventRender.
You can add any fields you want, fullcalendar will not change them.
events: [
{
title: 'John is sick',
start: '2013-11-19',
allDay: true,
description: 'Hurrayyyyyyyyyy',
myotherspecialfield: ':P'
},
{
title: 'Mike is on vacation',
start: '2013-11-21',
end: '2013-11-26',
allDay: true,
description: 'Hurrayyyyyyyyyy'
myotherspecialfield: ':P'
}
]
这篇关于将更多字段/数据添加到FullCalendar日的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!