DataTable - Reorder Both columns and rows can be reordered using dragdrop.
Draggable Columns
IdYearBrandColor
8e9b6a881967FiatMaroon
59e9dec32009HondaGreen
284d34111967VolvoSilver
3b296c462005BMWRed
27d14bd01995VolkswagenBlue
820964531977VolkswagenBlack
f4a583db1972JaguarMaroon
15edfbde2007FiatMaroon
ef6a6b841999JaguarGreen
8fa49a781982RenaultMaroon
Draggable Rows
IdYearBrandColor
eb48189f1985VolvoGreen
94e9a6c31967VolvoWhite
da80175b1966MercedesWhite
935f48651981FiatYellow
382207b61988RenaultGreen
d90076a11994FiatSilver
700648541962AudiSilver
36ee43211992JaguarWhite
e7b7063c2001FiatWhite
49c0266f1990BMWBlue
<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.