Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Grid handle focused rows/cells

Robert Christiansen
5 years ago Jan 31, 2017 10:16am

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

Tatu Lund
5 years ago Jan 31, 2017 11:28am
Robert Christiansen
5 years ago Jan 31, 2017 11:55am