Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flipped over dataTable primefaces

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>

enter image description here

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

like image 578
mondayguy Avatar asked Mar 04 '26 03:03

mondayguy


1 Answers

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.

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

like image 173
Kukeltje Avatar answered Mar 05 '26 21:03

Kukeltje



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!