V2.1 - dataGrid multiselect issue

Hi,
using 2.1.1…

When using the dataGrid with multiselect, generic filter and then use the
getSingleSelected to open the dialogWindow .editEntity ( the above edit, not the inline edit):

  • starting with filter 005, select first row and open the editor view looks fine
    image

  • changing the filter to 004, select first row and open the editor view shows still the old previous selected instance
    image
    and then in the editor it opens the wrong instance:
    image

I only works, when I first click on the deselect all icon and then selecting the row I want to edit…

Hi!

This happens because the selected item is not deselected even if it is hidden.
This is standard behavior of the Vaadin’s DataGrid selection model.

Changing the filter value doesn’t affect the selection model in any way. You will have to exclude the selected item from the model yourself using dataGrid.deselect() method.

UPD:
I created an issue to solve this problem from the framework side: Synchronize the Vaadin's DataGrid selection model and visual representation of data · Issue #2642 · jmix-framework/jmix · GitHub

Regards,
Dmitriy

2 Likes