vaadin / web-components

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
https://vaadin.com/docs/latest/components
429 stars 82 forks source link

[grid] Optional radio button column for single-select mode #1334

Open rolfsmeds opened 3 years ago

rolfsmeds commented 3 years ago

A static radio-button column, corresponding to the checkbox column for multi-select, would be beneficial for single-select Grids in three ways:

  1. Visually indicates to the user that rows are (single) selectable in a way that is consistent with multi-select.
  2. Selection by clicking regular cells could be optionally disabled to prevent usability conflicts with interactive cell contents (e.g. buttons)
  3. Solves current issue with editable cells not usable for seletion in vaadin-grid-pro by providing a dedicated selection element.
TatuLund commented 3 years ago

There is an example how to do this yourself here https://github.com/TatuLund/devday-demo-flow/blob/master/src/main/java/com/vaadin/devday/demo/views/GridView.java#L197 In addition to component column you need also extended radio button https://github.com/TatuLund/devday-demo-flow/blob/master/src/main/java/com/vaadin/devday/demo/views/GridView.java#L404

andersforsell commented 7 months ago

This is a good suggestion for accessibility when a vaadin-grid only has editable component columns, e.g. TextFields.