更改 primefaces Scheduler Event 的颜色 [英] Change the color of primefaces Scheduler Event
问题描述
我正在使用 primefaces(3.0) 调度程序组件.
I am using primefaces(3.0) scheduler component.
http://www.primefaces.org/showcase-labs/ui/schedule.jsf
正如我们在这里看到的,有一些事件是用颜色创建的蓝色.
As we can see here there there are some events created with color blue.
现在我想改变这些事件的颜色,基于独特性.例如,每个员工都有一个唯一的 ID关联.
Now I want to change the color of these events, on the basis of uniqueness. As a example for each empolyee there will be a unique ID associated.
因此,对于员工 ID 1,事件颜色将为蓝色,对于 ID 2事件颜色将是红色等等.
So for lets say for employee ID 1 Events color will be blue, for ID 2 events color will be red and so on.
如何将颜色应用于来自支持 bean 的这些数量的事件?任何线索....
how can I apply colors to these number of events from backing bean ? Any clue....
我可以通过这种方式更改调度程序的背景颜色,但不知道如何更改事件的颜色?
I am able to change the background color for scheduler in this way, but dont have any idea about how to change the color of events ?
推荐答案
如果需要,在同一个事件中添加样式类和数据.
if you need, add style class and data in the same event.
示例:
String id="2";
DefaultScheduleEvent evento = new DefaultScheduleEvent("titule", new Date(), new Date(), id);
evento.setStyleClass("event-close");
在 CSS 中,Damian 的反应很好.
In the CSS, Damian's response is good.
这篇关于更改 primefaces Scheduler Event 的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!