DataTable - Reorder Both columns and rows can be reordered using dragdrop.
Draggable Columns
IdYearBrandColor
509d948e1975RenaultRed
6fa401a51996VolvoGreen
8c32967a1971AudiRed
77cdea351969RenaultGreen
0faa658e1968VolkswagenBlack
4c3214b21981RenaultBlack
b90179311978FiatOrange
f05ec9311975HondaBrown
f4ea28b71995AudiBlue
376589a71985VolvoBlue
Draggable Rows
IdYearBrandColor
300c4fcb1995FiatYellow
764c494b2008RenaultRed
3f5f75962005RenaultRed
dc0c85e51982RenaultBlue
e3a4fb4b1990FiatYellow
66e5f0971987JaguarOrange
df676dca1962FordWhite
948b69232001RenaultWhite
0c6a4ace1973HondaWhite
f84aa51d2007FiatBlack
<h:form id="form">
    <p:growl id="msgs" showDetail="true" />

    <p:dataTable var="car" value="#{dtReorderView.cars1}" draggableColumns="true" style="margin-bottom:20px">
        <f:facet name="header">
            Draggable Columns
        </f:facet>
        <p:column headerText="Id">
            <h:outputText value="#{car.id}" />
        </p:column>

        <p:column headerText="Year">
            <h:outputText value="#{car.year}" />
        </p:column>

        <p:column headerText="Brand">
            <h:outputText value="#{car.brand}" />
        </p:column>

        <p:column headerText="Color">
            <h:outputText value="#{car.color}" />
        </p:column>
    </p:dataTable>

    <p:dataTable var="car" value="#{dtReorderView.cars2}" draggableRows="true">
        <p:ajax event="rowReorder" listener="#{dtReorderView.onRowReorder}" update=":form:msgs" />
        <f:facet name="header">
            Draggable Rows
        </f:facet>
        <p:column headerText="Id">
            <h:outputText value="#{car.id}" />
        </p:column>

        <p:column headerText="Year">
            <h:outputText value="#{car.year}" />
        </p:column>

        <p:column headerText="Brand">
            <h:outputText value="#{car.brand}" />
        </p:column>

        <p:column headerText="Color">
            <h:outputText value="#{car.color}" />
        </p:column>
    </p:dataTable>
</h:form>
                
PrimeTek, Copyright © 2017
All rights reserved.
Running PrimeFaces-6.3-SNAPSHOT on Mojarra-2.3.2.