使用Fullcalendar插件,是否有任何方法可以取消已完成的任务(至少使用<strike>
标记)。我正在从数据库中取出任务,结果传递给json_encode()
。
如果您使用的是v5版本,请将此添加到构造函数中:
eventClassNames: function(arg)
{
//standard event properties are under the "event" object
//and any other property/value you've added to the event
//object will be available under "event.extendedProps",
//just like this 'isUrgent' in the sample bellow:
if (arg.event.extendedProps.isUrgent)
{
return [ 'urgent' ]
}
else
{
return [ 'normal' ]
}
}
<style type="text/css">
.normal
{
text-decoration: none;
}
.urgent
{
text-decoration: line-through;
}
</style>
你可以创建一个类:
<style>
.strike-class{
text-decoration: line-through;
}
</style>
,然后在元素中为事件添加类:
eventRender: function(event, element){
if (completed) {
element.addClass("strike-class");
element.children().addClass("strike-class");
}
}