Hi Jmix team,
There is an issue that occurred to me while using SelectionEvent
for DataGrid components. Currently my users will perform a “double-click” onto any item on the DataGrid to trigger and EditAction
, but there are some scenarios where we program some handling during the SelectionEvent
itself and not customizing the EditAction
.
I found out that in Jmix’s DataGrid, selecting(clicking) on an already selected item on the DataGrid will deselect it instead, which sometimes occurs when user performs a “double-click” on an item. In our SelectionEvent
we usually use methods like dataGrid.getSingleSelectedItem()
and this will hit a null error because “deselecting” the item would also trigger the SelectionEvent
or the itemClickListener
event.
My question is, is there any good solution for this other than having a null checking on the dataGrid.getSingleSelectedItem()
function, can we prevent items from being “deselected” on the DataGrid? Or maybe something to prevent the SelectionEvent
from triggering twice if the user is double-clicking to trigger an EditAction
?