I'm using p:headerRow in my dataTable with a java.time.Instant field. It works fine but the rows appear in ascending order. How to reverse the order ?
<p:dataTable value="#{comptaPeriodeView.auditLines}" var="item" id="auditLines" widgetVar="auditLinesTb"> >
<p:headerRow field="inventaireAudit.inventaire.creationTime" expandable="true" expanded="true">
<p:column colspan="7" sortOrder="desc" >
<div class="inline-flex align-items-center" style="vertical-align: middle">
<h:outputText value="#{format.zdEuropeParis(item.inventaireAudit.inventaire.creationTime)}">
<f:convertDateTime type="zonedDateTime" pattern="dd/MM/yyyy HH:mm:ss" />
</h:outputText>
</div>
</p:column>
</p:dataTable>
Edit : Same problem with the showcase "Row Group" : how to reverse the order of the representative names ?
I took a look at
org.primefaces.component.headerrow.HeaderRowBaseand there is asortOrdervalue. So addingsortOrder="desc"does the trick. For example in showcase :This attribute is missing in the documentation :
https://primefaces.github.io/primefaces/13_0_0/#/components/headerrow