【问题标题】:How to hide time-slots in "agendaWeek" View of FullCalendar/Primefaces <p:schedule>?如何在 FullCalendar/Primefaces <p:schedule> 的“agendaWeek”视图中隐藏时间段?
【发布时间】:2012-10-12 09:50:51
【问题描述】:

是否可以在“agendaWeek”视图中隐藏时间段?我正在使用基于 FullCalendar 的 Primefaces &lt;p:schedule&gt;。我只将 AllDay-Events 添加到这个特定的时间表中,所以我的客户决定隐藏时间段。

希望有办法。

最好的问候

【问题讨论】:

  • 有什么原因不能使用月视图?
  • 我已经在使用月视图了。这就是问题所在,我的客户想要“议程周”视图,以防“全天”事件太多。所以这两种观点都是需要的。

标签: primefaces hide fullcalendar schedule


【解决方案1】:

您不能只使用 basicDay 和 basicWeek 视图吗?而不是议程周/议程日?这两个视图没有显示时间段......节省了 CSS 等的混乱!

【讨论】:

  • 这是最好的答案!
【解决方案2】:

自定义标题模板,它将为您节省大量的 css 更改。

     <p:schedule id="mySechedule" 
rightHeaderTemplate="month, basicWeek, basicDay" 
value="#{myBean.eventModel}"/>

【讨论】:

    【解决方案3】:

    不知道是不是你的意思

    但要隐藏计划中的第一列,请尝试使用这个 css 选择器(如果您在包含计划程序的表单中有 prependId = "false",请删除 formID\3A

    #formID\3A scheduleID th.fc-agenda-axis{
        display:none
    }
    

    或运行此 js 代码(在 primefaces 展示柜上测试)

    jQuery("th.fc-agenda-axis").hide()
    

    更新

    这是隐藏时隙的方法(OP 真正在寻找什么)

    #formID\3A scheduleID table.fc-agenda-slots{
        display:none
    }
    

    【讨论】:

    • 嗯,这似乎不适合我。我试过第一个。最后一个。但我确定我做错了什么。您将最后一个解决方案放在 anwser 中的什么位置?
    • 擦 jquery ,只需浏览到primefaces.org/showcase/ui/schedule.jsf 并单击周视图,而不是在您的 chrome/ff 中使用 F12 打开开发工具并将代码粘贴到控制台中,没有尝试过 css 选择器,但如果它不起作用,请尝试 formID\:AscheduleID th.fc-agenda-axis \: 而不是 \3A 或在 \3A 和 scheduleID 之间添加空格
    • 我的 FormID 是“frm_plan”,而 scheduleID 是“sde_plan”,所以我添加到我的 css:frm_plan\:sde_plan th.fc-agenda-axis。 Firebug 和 Opera 不再显示时间表,Chrome 似乎不理解我在我的 CSS 中定义的内容。它显示计划正常。我将在上面添加我的布局和日程安排页面。
    • 我忘了在formID 之前添加#,试试#frm_plan\:sde_plan th.fc-agenda-axis
    • 谢谢,但我的意思是:#frm_plan\:schedule table.fc-agenda-slots 所以你可以隐藏所有时间段的表格。 #frm_plan\:schedule table.fc-agenda-axsis 非常感谢您的帮助。能解答一下和我有同样问题的朋友吗?
    【解决方案4】:

    要隐藏月份-按钮,只需使用此代码。

    <style type="text/css">
    .fc-button-month{ display: none; }
    </style>
    

    -按钮使用 CSS 选择器.fc-button-agendaWeek-按钮:.fc-button-agendaDay

    问候!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多