我在ruby on rails上使用fullcalendar
,它工作得很好。我试图改变一个事件的backgound_color
属性,但我看不出如何得到它。我可以改变边框颜色。
我的JSON看起来像:
[
{
"_routes": null,
"title": "this should be red",
"color": "#2308d1",
"url": "/events/59",
"start": "2013-06-18T00:00:00-05:00",
"end": "2013-06-18T22:59:59-05:00",
"allDay": false,
"event_id": 59,
"background_color": "red"
},
]
我想做一些好东西与社区分享,源代码在这里https://github.com/mzararagoza/rails-fullcalendar-icecube
看起来你需要使用backgroundColor而不是background_color。
https://github.com/arshaw/fullcalendar/blob/1009caf3b792ad5958d0660ebcfee49fad6f7026/src/util.js可以为每种类型的事件定义一个类名,如下所示:
[
url: ajaxcallURL(_url,"6"),
type: 'POST',
//error: function() { alert('something broke with courses...'); },
data:{
'func':func,
'year':y
},
cache: false,
color: '#FF931E', //This is the color for the events
textColor: 'white'
className: 'myCssClassName' //in the Css you can use the class to set the background color for the events, i think this overrides color property.
]
或者你在考虑表格单元格的颜色吗?因为这是完全不同的东西