【问题标题】:Fullcalendar- how to strike off and display completed tasksFullcalendar-如何删除和显示已完成的任务
【发布时间】:2011-10-31 15:46:56
【问题描述】:

有了 Fullcalendar 插件,有没有办法取消已完成的任务(至少使用<strike> 标签)。我正在从我的数据库中取出任务并将结果传递给json_encode()

【问题讨论】:

    标签: jquery fullcalendar


    【解决方案1】:

    如果您使用的是 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>
    

    【讨论】:

      【解决方案2】:

      你可以创建一个类:

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

      然后在元素中将类添加到事件中:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-06-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多