【问题标题】:Primefaces datatable pagination on bottom screen底部屏幕上的 Primefaces 数据表分页
【发布时间】:2017-04-11 10:33:13
【问题描述】:

我有一个数据表来显示我的数据库中的数据。我在“底部”位置包含对我的数据表的分页。我的代码:

<p:dataTable var="item" id="initemList" widgetVar="initemList" value="#{initemController.initems}"
                 paginator="true" rows="50" reflow="true"
                 paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {CurrentPageReport}"
                 currentPageReportTemplate="{startRecord} - {endRecord} of {totalRecords}" paginatorPosition="bottom"
                 rowsPerPageTemplate="10,25,50" selectionMode="single" scrollable="true"
                 selection="#{initemController.selectedInitem}" rowKey="#{item.itemid}">

结果,这是我的数据表:

我的分页不在底部屏幕上,而是在我的数据下方。我怎样才能做到这一点?

【问题讨论】:

    标签: html css primefaces xhtml


    【解决方案1】:

    这是样式问题。使用您的浏览器开发工具(在大多数浏览器中为 F12)选择您想要设置样式的节点。在 Chrome 中,您也可以右键单击该节点并选择“检查”。

    现在找到创建自定义 CSS 规则所需的类。在你的情况下:ui-paginator-bottom

    然后创建一些自定义样式。根据您的模板,您最终可能会得到以下内容:

    .ui-paginator-bottom {
        position: fixed;
        bottom: 0;
    }
    

    另见:

    【讨论】:

    • 但是要让它工作,你需要给'.ui-paginator'所在的'容器'一个固定的高度,否则它仍然是一样的,不是吗?
    • @Kukeltje 对我来说这是有效的。但这可能取决于现有的其他样式。
    猜你喜欢
    • 2013-04-29
    • 2013-08-19
    • 1970-01-01
    • 2012-12-10
    • 1970-01-01
    • 2015-08-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多