Reordering Columns with DragDrop

Reordering datatable columns with drag and drop has been a popular feature request from PrimeFaces Community with more than 70 votes. With this motivation, we’ve implemented this request targeting the upcoming 3.2 release.

And here is a photo from our design process we’d like to share all the math. Well, of course you don’t need to care about this, just set draggableColumns attribute to true and that’s it. :) Client side changes are synced with server side component state under the hood and “columnReorder” ajax behavior is provided for optional use to implement further customizations. So once again, we are following our “Hide Complexity, Keep Flexibility” goal.

Check out PrimeFaces 3.2 Labs to take a look at this new feature!

5 thoughts on “Reordering Columns with DragDrop

  1. Great addition to the component.

    It is possible to reorder the columns dynamically created?

    I am very interested in seeing a component that behaves like a DataTable, but allow to generate hierarchies as is possible in the treetable.

    In addition to this, wish it was possible to freeze the first column and leave the other scroll normally.

    If you have no plan to implement this soon. It would be possible I do it? Using the DataTable and adding the behavior of hierarchical tree in it?

    Send me email if you consider an interesting idea.

    Thank you, your work is an inspiration to me.

  2. p:columns (dynamically created columns) are supported for reordering as well. Frozen Columns an Frozen Rows are likely to be in 3.3. Thanks for your feedback.