FlowingCode / TwinColGridAddon

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

Possibility to swap grids/sides #87

Closed tali-vitali closed 2 years ago

tali-vitali commented 2 years ago

Can you please tell me if it is possible to forcibly swap the grids? While maintaining the logic of the migration buttons. For example, to force a grid with selected items to the left instead of the right.

javier-godoy commented 2 years ago

Hello.

If the component is inside of an RTL container, the grid with the selected items will be positioned to the left. image

For LTR languages, TwinColGrid is rendered as a vaadin-horizontal-layout inside of a vertical layout. You can set a flex-direction: row-reverse style in order to swap the grids.

image

In both cases, you will also need to rotate the buttons (since the arrow that selects items will always point to the right, regardless of dir/reverse settings)

Please let us know if you think of any addition in the API than can assist in your use case,

tali-vitali commented 2 years ago

It would be nice to be able to do this out of the box (styles of grids and buttons) with set of one property. And also replace the concepts/namings of "right" and "left" grid (in favor of "available" and "selections" for example), because in our case, as well as in the case of a vertical alignment, it is no longer relevant.

javier-godoy commented 2 years ago

And also replace the concepts/namings of "right" and "left" grid (in favor of "available" and "selections" for example), because in our case, as well as in the case of a vertical alignment, it is no longer relevant.

That's right, the left/right naming convention predates the orientation feature. I'll create a separate issue for discussing that.

javier-godoy commented 2 years ago

Released in v2.5.0

tali-vitali commented 2 years ago

thanks!