简体   繁体   中英

Row Click Event in vaadin-grid polymer

I have a requirement where a user selects a row(or a cell, for that matter) and presses some key(such as Enter , this is configurable) and I need to take some action based on the key pressed (such as opening a dialog with detailed information about the row).

As I was looking in the code, I stumbled upon a key event handler in vaadin-grid-keyboard-navigation-mixin.html . But the _onKeyDown method handles only some specific keys. And I am not sure how to pass a callback to that function.

Any ideas regarding how this can be done. I just want to attach an key event handler to each cell, that capture the key event(again this is not fixed), and execute appropriate method.

I hope that I have been able to convey my intentions.

Thanks

您的类必须实现KeyNotifier,然后可以添加keyPressListener,即:

addKeyPressListener(Key.ARROW_DOWN, event -> anAwesomeFuncion());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM