问题
How do I add a 2x click listener on a vaadin grid? When I 2x click on it, it takes me to another page. Example would be most appreciated.
回答1:
With the MouseEvent you can simply ask for a double click.
See here #MouseEvents.ClickEvent.html#isDoubleClick()
回答2:
Here is an example:
grid.addItemClickListener(listener ->
{
if (listener.getMouseEventDetails().isDoubleClick())
// pass the row/item that the user double clicked
// to method doStuff.
doStuff(l.getItem());
}
);
来源:https://stackoverflow.com/questions/33356734/doubleclick-listener-on-vaadin-grid