【问题标题】:Fixed headers in rich:datatable修复了rich:datatable中的标题
【发布时间】:2014-03-26 10:34:09
【问题描述】:

我无法修复来自rich:datatable 的标题。

在我丰富的数据表负载中有很多列。滚动时,我丢失了列表的标题。如何修复标题?

<div style="overflow:auto; height:500px; width:100%;" id="ere">
    <rich:dataTable id="solicitudMonitoreoVehicular"  headerClass="alignLeft" frozenColumns="2"
            value="#{listarServicioEnMonitoreoAsesoriaController.lstSolicitudMonitoreoVehicular}"
            var="item" >

            <rich:column  styleClass="#{item.color == null ? '' : item.color}">
                <f:facet name="header">
                    <h:outputText value="Placa" />
                </f:facet>
                <h:commandLink styleClass="no-decor" execute="@this"
                    value="#{item.placa}">
                    <f:setPropertyActionListener
                        target="#{listarServicioEnMonitoreoAsesoriaController.solicitudMonitoreoVehicular}"
                        value="#{item}" />                      
                </h:commandLink>
            </rich:column>
.....
....
...

【问题讨论】:

  • 很抱歉,您的问题不清楚。能详细点吗?
  • 我有一个大列表,当我搜索一行时,我看不到数据表的标题,我需要修复标题的位置并同时滚动所有列表
  • 对行数添加限制(例如 20)并使用分页呢?

标签: jsf header richfaces fixed richdatatable


【解决方案1】:
rich:extendedDataTable

frozenColumns 属性。

由于 rich:extendedDataTable 组件涉及复杂的标记,它不支持使用 rich:collapsibleSubTable 组件。 rich:collapsibleSubTable 组件仅适用于 rich:dataTable 组件。

同样,使用 breakRowBefore、colSpan 和 rowSpan 属性的复杂行和列跨越也不适用于 rich:extendedDataTable 组件。

我也在寻找解决方案,但我正在考虑用一些不同的设计来实现,正如@Vasil 提到的我们可以使用行计数和分页。

以下代码使用行数和分页

    <div style="overflow:auto; height:500px; width:100%;" id="ere">
<p align="center">
    <rich:dataScroller for="table" maxPages="5" />
</p>
<rich:dataTable width="1200" var="record" id="table"  border="0" cellpadding="0" cellspacing="0" styleClass="tablemargin tableDetails"  
        value="#{customerController.topCustomer}" rows="2">


<f:facet name="header">
            <rich:columnGroup>
                <rich:column styleClass="width50">

                </rich:column>
                    ......
                    .......
                <rich:column styleClass="width70">
                    .......
                </rich:column>
            </rich:columnGroup>
</f:facet>
        <rich:collapsibleSubTable var="item" value="#{record.items}" rowKeyVar="rowKey" >
            ..........
            .........
        </rich:collapsibleSubTable>     

</rich:dataTable>
<p align="center">
    <rich:dataScroller for="table" maxPages="5" />
</p>
     </div>

【讨论】:

    猜你喜欢
    • 2018-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-11
    • 2013-06-18
    相关资源
    最近更新 更多