vaadinvaadin-flowvaadin-grid

Vaadin grid details behaviour


Could you please advice whether is it possible to achieve the following behavior with the Vaadin Grid details:

  1. Do not show details row based on grid item content.
  2. Do not collaps previously expanded details on another rows (be able to show details for more than one row).

I am using the latest release version of Vaadin 24.

Thanks in advance, Vadim


Solution

  • Yes to both.

    You can toggle the visibility of the details panel manually with the setDetailsVisible(T item, boolean visible) method, e.g. triggered from a clicklistener on the row, depending on the item on that row.

    The 2nd example in this section https://vaadin.com/docs/latest/components/grid#item-details has an example of using that method, and also demonstrates having multiple details open simultaneously.