翻转数据表格 [英] Flipped over dataTable primefaces

查看:137
本文介绍了翻转数据表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在标题中翻转datatable,以便在左侧的标题不在顶部?
我有以下表格:

Is it possible to flip datatable in primefaces, in order to have headers in the left not in the top? I have following table:

<p:dataTable value="#{rolesMgmt.listOfMapsRoles}" var="map" id = "dataTable">
    <p:columns value="#{rolesMgmt.columns}" var="column">
        <f:facet name="header">
            <h:outputText value="#{column.header}" />
        </f:facet>
        <h:outputText value="#{map[column.property]}" />
    </p:columns>
</p:dataTable>

如你所见,我有很多标题和2-3行,我需要翻转这个表

As you see, I have a lot of headers and 2-3 rows and I need to flip this table

推荐答案

不能通过在 p:dataTable 本身使用某些属性来实现。为了实现这一点,您需要转置您的模型。也许你可以通过操纵响应来实现一些。但是如果你有很多列和很多行,也许你应该考虑在数据表中显示一个'summary'并且有一个详细信息视图。

No this is not possible by using some attribute on the p:dataTable itself. For this to be achieved you need to transpose your model. Maybe you can achieve something by manipulating the responsiveness. But if you have lots of columns AND lots of rows, maybe you should think of just displaying a 'summary' in a datatable and have a details view.

或使用 p:datagrid showcase )您可以在其中排序自由格式化您的记录或简单的ui:重复?因为在这种情况下你似乎不需要排序/过滤等。 p:datatable 似乎对我来说太过分了

Or use a p:datagrid (showcase) where you can sort of free-format your records or a plain ui:repeat? Since you do not seem to need sorting/filtering etc in this case. The p:datatable seems overkill to me now

这篇关于翻转数据表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆