Primefaces 更改时间表';从backbean中删除事件CSS
我需要根据一些规则更改事件背景颜色,我已经尝试了Primefaces 更改时间表';从backbean中删除事件CSS,primefaces,schedule,Primefaces,Schedule,我需要根据一些规则更改事件背景颜色,我已经尝试了setStyleClass(),但没有成功(我已经在页面中使用了,和内联CSS) 我的CSS(也尝试了.fc事件皮肤e在web中搜索所有变体) backbean代码的一部分: Paciente p = pDAO.getById(9999998, Paciente.class); IdAgenda idAgend = new IdAgenda(dataHoje, p, ambulatorioDoUsuario);
setStyleClass()
,但没有成功(我已经在页面中使用了
,
和内联CSS)
我的CSS(也尝试了.fc事件皮肤e在web中搜索所有变体)
backbean代码的一部分:
Paciente p = pDAO.getById(9999998, Paciente.class);
IdAgenda idAgend = new IdAgenda(dataHoje, p, ambulatorioDoUsuario);
Agenda a = new Agenda(idAgend, diaDeHoje, 1, null, null, false, null, true, false, false, null, false);
apagarSemMensagem();
success = aDAO.save(a);
if (success == true) {
novoAgendamento.setTitle(p.getNome());
novoAgendamento.setStyleClass("atendido");
eventModel.addEvent(novoAgendamento);
}
附表:
<p:schedule id="agendaOcupacional" allDaySlot="false" slotLabelFormat="HH:mm" widgetVar="myAgendaOcupacional"
draggable="false" resizable="false" timeZone="GMT-3" extender="initSchedule" class="bg" slotEventOverlap="false"
showWeekends="false" view="agendaDay" slotDuration="00:15:00" value="#{agendamentoBean.eventModel}" locale="br" >
<p:ajax event="dateSelect" listener="#{agendamentoBean.onDateSelect}" oncomplete="PF('myAgendaOcupacional').update()"/>
<p:ajax event="eventSelect" listener="#{agendamentoBean.onEventSelect}" />
</p:schedule>
我用的是PrimeFaces7.0
编辑:在Primefaces 5.0中使用fc事件内部。在Primefaces 7.0中,您可以使用
.fc bg
使用以下CSS代码:
.atendido .fc-bg {
background-color: red;
border-color: red;
color: white;
opacity: 1;
}
在backbean中,我只调用了
event.setStyleClass(“atendio”)代码>对不起,我已使用日程代码进行了更新。是的,我可以在源代码中看到“atendido”,但在事件本身中看不到,只是在源代码中可以尝试CSS规则.atendido.fc event
(因此类之间没有空格)?@JasperdeVries已经尝试过了,不起作用。您需要创建一个比body.fc.fc event
更具体的规则。看见
.atendido .fc-bg {
background-color: red;
border-color: red;
color: white;
opacity: 1;
}