0

我有一个p:schedule显示 2 种事件的。列表Events中充满了Try这样的方法:

//ResourceEvents
eventResourceAvailPerDay.addEvent(new DefaultScheduleEvent(reason, dateBeginConverted, dateEndConverted, "resource"));

//WaitingItemEvents
DefaultScheduleEvent newResourceEvent = new DefaultScheduleEvent(reason, dteBeginOrWaitingItem, dteEndOrWaitingItem, orWaitinglist.getWKey());
newResourceEvent.setStyleClass("waitingitem");
eventResourceAvailPerDay.addEvent(newResourceEvent);

2Events具有上面创建的以下 css 类resourcewaitingitem

以下是我想要实现的目标: 在月视图中,我只希望waitingitem类可见,因此隐藏resource类,如果可能的话,还可以覆盖 JSP 2.0,这些事件(waitingitem)是不可点击的。在 weekview 和 dayview 中只有resource类应该是可见的

我已经有以下 css 代码,它没有给我想要的结果:

.waitingitem, .schedule .waitingitem .fc-view-month, .waitingitem a {
    display: none;
}
.waitingitem, .schedule .waitingitem .fc-view-agendaWeek, .waitingitem a {
    display: block!important;
}
.resource, .schedule .resource .fc-view-month, .resource a {
    display: block;
}
.resource, .schedule .resource .fc-view-agendaWeek, .resource a {
    display: none!important;
}
.resource, .schedule .resource .fc-view-agendaDay, .resource a {
    display: none!important;
}

有什么建议么?

更新//工作CSS

schedule .fc-view-month .resource, 
.schedule .fc-view-agendaWeek .resource,
.schedule .fc-view-agendaDay .resource,
.schedule .fc-view-agendaWeek .waitingitem
.schedule .fc-view-agendaDay .waitingitem
{
    display: block;
}
.schedule .fc-view-month .waitingitem 
{
    display: none!important;
}
4

1 回答 1

1

You can try something like that :

#id-of-a-parent .fc-view-month .resource,
#id-of-a-parent .fc-view-agendaWeek .waitingitem,
#id-of-a-parent .fc-view-agendaDay .waitingitem
{
    display: none;
}

#id-of-a-parent .fc-view-month .waitingitem,
#id-of-a-parent .fc-view-agendaWeek .resource,
#id-of-a-parent .fc-view-agendaDay .resource
{
    display: block;
}

Note : #id-of-a-parent can be what ever you want, just to make the rules more important.

Does that make sense? I still can't test on your setup.

于 2013-05-14T09:26:30.263 回答