簡體   English   中英

在主圖中隱藏p:schedule的事件時間

[英]Hide the Event time of p:schedule in primefaces

我正在使用素數<p:schedule>並且我想在某些情況下隱藏事件時間。

我使用的條件是傳遞給DefaultScheduleEvent的對象的屬性,該對象也具有事件標題。

我發現的解決方案是使用display:none; 對於CSS類.fc-event-time ,它將在計划中隱藏所有事件時間。

所以我想做的是當我創建一個新的DefaultScheduleEvent

defaultScheduleEvent = new DefaultScheduleEvent(item.getFormule().getLibelle(), startPlanningDate, endPlanningDate, "formuleColor" + item.getFormuleCremation().getId());

它將調用item.isDispo() ,如果為true,則我們將隱藏事件時間,否則將其顯示。

我怎樣才能做到這一點 ?

您可以通過兩種方式執行此操作:

  1. 延長fc-time CSS

CSS

.fc-time, .hide-time {
    display:none;
}

豆角,扁豆

String hideCss = "";

if (item.isDispo()) {
    hideCss = "hide-time";
}

defaultScheduleEvent = new DefaultScheduleEvent(item.getFormule().getLibelle(), startPlanningDate, endPlanningDate, "formuleColor" + item.getFormuleCremation().getId() + " " + hideCss);
  1. allDay標志設置為true

豆角,扁豆

defaultScheduleEvent = new DefaultScheduleEvent(item.getFormule().getLibelle(), startPlanningDate, endPlanningDate, item.isDispo());

第二種方法不適用於您的情況,因為您添加了"formuleColor" + item.getFormuleCremation().getId()作為自定義css

希望這可以幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM