FlowingCode / TwinColGridAddon

TwinColGrid Vaadin Add-on
https://www.flowingcode.com/en/open-source/
Apache License 2.0
7 stars 7 forks source link

Allow re-ordering of the right side #90

Closed higgsja closed 2 years ago

higgsja commented 2 years ago

Often, we provide a list of columns to choose from for subset data display. Having chosen the appropriate columns, the client wants to then change the order with drag and drop in the 'selected' side.

Possible?

javier-godoy commented 2 years ago

Yes. You can set column reordering allowed on the selection grid:

twinColGrid.getSelectionGrid().setColumnReorderingAllowed(true);
higgsja commented 2 years ago

Sorry if you see this twice as I replied to the email.

To be clear, after getting the subset of elements from the left to the right side, I want to be able to drag/drop or otherwise re-order the right side, i.e., move the items up and down in the selected side.

Column reordering sounds like shifting columns around. Will it really do what I'm asking?

javier-godoy commented 2 years ago

Column reordering sounds like shifting columns around. Will it really do what I'm asking?

It won't. I got it wrong.

I want to be able to drag/drop or otherwise re-order the right side, i.e., move the items up and down in the selected side

It would require drag-and-drop listeners that handle dragging within the same grid (as in https://cookbook.vaadin.com/grid-dnd-reorder-rows), which is currently not implemented by the component. I think we can make it an optional feature of TwinColGridAddon.