在完整日历中更改单元格的颜色 [英] change the color of a cell in a full calendar
问题描述
我的要求是:对于列表中的某个td单元应该有相同的颜色。
我需要改变arshaw完整日历的单元格的颜色。假期由公司提供。
雇员假期列表中的td单元应具有相同的颜色。
我们如何实现这一点。我可以更改颜色的事件,但不是细胞。
另外如果我们可以根据假期更改单元格内一天的颜色并离开。
如果您使用的是Jquery-Ui主题,则需要移除ui-widget-content类并应用您自己的类。在下面的代码中,我使用了一个带有紫色平面颜色的40x100图片。
CSS
.holiday
{
border:1px solid#69196c;
background:#764ead url(holiday.png)50%top repeat-x;
颜色:白色;
}
JS FULLCALENDAR
<$ ($ .inArray(date,holidays)> = 0){
$ b $(
$ b $ dayRender:function b //如果你不使用ui主题,只需删除这行
$(cell).removeClass('ui-widget-content');
$(cell).addClass('holiday');
}
}
I need to change the color of a cell of a arshaw full calendar.
My requirement is :There should be a same color for a td cell for list of holidays provided by a company. There should be a same color for a td cell for list of holidays taken by an employee.
How we can achieve this.I am able to change the color of events but not the cell.
Also If we can change the color of a day inside a cell according to holidays and leave .
If you are using Jquery-Ui theme you need to remove ui-widget-content class and apply your own class. In the code below i'm using a 40x100 image with purple flat color.
CSS
.holiday
{
border:1px solid #69196c;
background: #764ead url(holiday.png) 50% top repeat-x;
color: white;
}
JS FULLCALENDAR
dayRender: function (date, cell) {
if ($.inArray(date, holidays) >= 0) {
// if you aren't using ui theme, just remove this line
$(cell).removeClass('ui-widget-content');
$(cell).addClass('holiday');
}
}
这篇关于在完整日历中更改单元格的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!