Change the color of primefaces Scheduler Event

后端 未结 6 1576
温柔的废话
温柔的废话 2020-12-15 14:08

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 create

6条回答
  •  一整个雨季
    2020-12-15 14:37

    apply this code when use primefaces 4.0

    eventModel = new DefaultScheduleModel();  
    eventModel.addEvent(new DefaultScheduleEvent("Event for employee 1", new Date(), laterToday(), "emp1"));
    eventModel.addEvent(new DefaultScheduleEvent("Event for employee 2", tomorrow(), laterTomorrow(), "emp2"));  
    

    emp1 and emp2 are the style classes. Then add the following css to your style sheet:

    .emp1 .fc-event-inner {
        background: red;
    }
    .emp2 .fc-event-inner {
       background: green;
     }
    

提交回复
热议问题