【问题标题】:change the event color of two different events of fullcalendar?更改fullcalendar的两个不同事件的事件颜色?
【发布时间】:2014-10-23 04:30:56
【问题描述】:

我正在使用完整的日历,我想应用一个条件,其中预约接受的事件以绿色显示,待处理的请求预约以红色显示。 如何将不同的颜色应用于不同的 2 事件?

【问题讨论】:

  • 作为变体,您可以将status 属性添加到您的事件并检查它的状态。如何更改事件背景颜色,您可以看到here

标签: fullcalendar


【解决方案1】:

我正在使用回调eventRender,检查特定字符串的属性并通过 jQuery 更改颜色:

eventAfterRender: function ( event, element ) {
    console.log( event ); // Debug
    if( event.title.indexOf("Pending") > -1 ) { // if title contains "Pending"
        element.css( {'background-color': '#14B9E2', 'border': '1px solid #14B9E2'} );
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-23
    • 2012-12-07
    • 1970-01-01
    • 1970-01-01
    • 2013-10-10
    相关资源
    最近更新 更多