Hi,
I have a DataGrid, and on deleting an entry with
dataProvider.remove(singleSelectionModel.getSelectedObject());
the selection jumps right onto the first field in the Grid.
However, executing the deletion again (by a Button), the visibly selected
first element is NOT deleted.
Thus, somehow
DataGrid has two selections. In its default style darkblue is the selection
stored in the selection model while a yellowish selection is the keyboard
selection to let you know where you are while navigating with the
keyboard.
Maybe you have defined the same color for both so you cant
Ah ok, that makes it much clearer. I found out that I can only delete a
cell if I click it before. If I click it and use the keyboard to navigate
away from it, I cannot delete it anymore.
Also on deleting of mouse-selected object, the keyboard focus seems to be
set to the first element in the
DataGrid.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.BOUND_TO_SELECTION)
should make the keyboard selection the same as the contents of your
selection model.
-- J.
Am Dienstag, 19. Februar 2013 12:21:07 UTC+1 schrieb membersound:
Ah ok, that makes it much clearer. I found out that I
Great, that seems to work at least.
Still I'm not succeeding in disabling the initial selection of the first
entry in the DataGrid after selected row has been deleted.
That's a real problem, because I trigger deletes with DEL key, and if I
keep it pressed this would start to delete the whole