开发者

Fullcalendar- how to strike off and display completed tasks

With the Fullcalendar plugin, is there any way to strike off completed task开发者_StackOverflow社区s (atleast using <strike> tag). I am taking the tasks out of my database and the results is passed to json_encode().


If you're on v5 add this to the constructor:

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>


you can create a class:

<style>
    .strike-class{
        text-decoration: line-through;
    }
</style>

and then in the element add the class to the event:

eventRender: function(event, element){
                    if (completed) {
                        element.addClass("strike-class");
                        element.children().addClass("strike-class");
                    }
                }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜