How to make a multi select for a hierarchical grid without checkboxes

Hi

I need a simple multi select mode in which the user can select items on a hierarchical grid with mouse or touch device. No checkboxes on the left, just the selected items coloured. How to do this? Is there some plugin for this, vaadin14?

https://vaadin.com/api/platform/14.4.0/com/vaadin/flow/component/grid/Grid.SelectionMode.html

Thanks.

There is “hidden” property in vaadin-grid-flow-selection-column element, in order to hide you need to use the following JavaScript call:

    public void onAttach(AttachEvent event) {
        grid.getElement().executeJs("this.getElementsByTagName(\"vaadin-grid-flow-selection-column\")[0]
.hidden = true;");
    }

This will render the multiselection column useless, so you need to add item click listener to explicitly select items that you click on row

    grid.addItemClickListener(event -> {
        MyBean item = event.getItem();
        if (grid.getSelectedItems().contains(item)) {
            grid.deselect(item);
        } else {
            grid.select(event.getItem());
        }
    });