【问题标题】:Specifying the color of an event in Full Calendar在完整日历中指定事件的颜色
【发布时间】:2014-02-15 05:48:16
【问题描述】:

我有一个日历http://arshaw.com/fullcalendar/:

$('#calendar').fullCalendar({
    height: 300,
    //.............

    events: jsonData,
    month: firstMonth
  })

我想根据jsonData 中每个值(项目)的某些条件动态设置事件的color。我该怎么做?

请注意,我不能这样做:

eventSources: [
    {
      events: [  
        {
          title     : 'event1',
          start     : '2012-06-10'
        }
      ],
      backgroundColor: 'green',
      textColor: 'yellow'
    },

或其他什么,因为我必须在传递给日历之前将jsonData 分成两部分,然后将它们中的每一个传递给日历。我不想要这个。相反,我想要一些回调函数,我可以在其中访问每个项目并设置事件的颜色。类似eventMouseover。

【问题讨论】:

标签: javascript jquery css calendar fullcalendar


【解决方案1】:

【讨论】:

    【解决方案2】:

    您可以将事件编写为具有回调函数的函数,也可以使用事件源来传递 2 个或更多 jsondata。

    这是它的链接http://arshaw.com/fullcalendar/docs/event_data/events_function/

    【讨论】:

      猜你喜欢
      • 2015-06-21
      • 2011-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-16
      • 1970-01-01
      • 2014-12-15
      相关资源
      最近更新 更多