3

How do I catch double click event in gxt tree grid? I already try this from : Click Handlers for Trees in GXT 3?

tree.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
tree.getSelectionModel().addSelectionHandler(new SelectionHandler<MenuView.MenuDto>() {

    public void onSelection(SelectionEvent<MenuDto> event) {
        MenuDto mnu = event.getSelectedItem();
        Info.display("Tree Handler", mnu.getDescripcion());
    }
});

But it only works for single click, not double click.
I want if user press double click, pop up will show.

Community
  • 1
  • 1

2 Answers2

0

Selection has specific meaning in this case - are you sure you want doubleclick to cause selection to happen, and only then you want to be notified?

Instead, look at grid.addRowDoubleClickHandler - your handler will be given the row index that was clicked, and you can then ask the store what item is in that row.

Relevant GXT Javadoc:

Colin Alworth
  • 17,801
  • 2
  • 26
  • 39
0

This is the code, i only test to see info display :

tree.addRowDoubleClickHandler(new RowDoubleClickHandler() {
    @Override
    public void onRowDoubleClick(RowDoubleClickEvent event) {
        Info.display("hello", "double click");
    }
});