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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
CssImport when using Component Exporter by Mikhail Shabarov, 4 weeks ago
how to select row with keyup and keydown in grid element
I look a way to autoselect row with keyup and keydown (without press enter) in the grid element;
It would be convenient for me have an even like "focues-items-changed" just like selected-items-changed.
For now the only solution i have found is uncomfortable...
Is there a way to know when row get focus ?
Thanks in advance
p.s.
This is temporary solution that I found. Is there a better way to implement it ?
//grid is vaadin-grid polymer element
grid.addEventListener('keyup', function(e) {
var i=grid.selection.selected()[0];
if (i===undefined) {
grid.selection.select(0);
return;
}
if (e.code=="ArrowDown") {
if (i==grid.items.length) return;
i++;
grid.selection.select(i);
}
if (e.code=="ArrowUp") {
if (i==0) return;
i--;
grid.selection.select(i);
}
//TODO: handle PageUP and PageDown
});
Is there a way to know when the focus of a line change?
Last updated on
You cannot reply to this thread.