Grid handle focused rows/cells

Hey there,

I would love to know how to access the currently focused row in Grid. If you use keyboard to navigate up/down the rows, Grid updates the focused row.
If I press SPACE the focused row will be selected. If I press ENTER the focused row will be in edit state.
Now I want to change the ENTER event on my read-only table. Ideally I want to open the ContextMenu (https://vaadin.com/addon/vaadin-contextmenu) like I pressed right mouse button. But because I don’t want to mess up with two APIs I just want to get the focused row. Like Grid#getSelectedRow but Grid#getFocusedRow().

Is there a way to get the focus state without writing client extension?

Thanks in advance
Robert

Check this add-on (GridFastNavigation), it is ready made navigation solution if use Grid with unbuffered edit mode.

https://vaadin.com/directory#!addon/gridfastnavigation-add-on

Here is an another example implementation for you to study.

https://github.com/bonprix/vaadin-grid-enhancements/tree/master/GridEnhancements/GridEnhancements/src/main/java/org/vaadin/grid/enhancements/navigation

Hey Tatu,
awesome news, thanks for the information. At the first glance it exactly looks like what I am looking for :slight_smile: