Ejemplo n.º 1
0
 private void filtrar() {
   grid.getDataProvider().setFilter(txtBuscar.getText());
   if (grid.getDataProvider().hasFilter()) {
     int alto = grid.getDataProvider().resulted.size() * 15;
     // grid.setHeight(alto + "mm");
   } else {
     int alto = grid.getData().size() * 15;
     // grid.setHeight(alto + "mm");
   }
   grid.getDataProvider().refresh();
 }
Ejemplo n.º 2
0
 @Override
 public void onKeyUp(KeyUpEvent event) {
   if (event.getSource().equals(txtBuscar.textBox)) {
     grid.getDataProvider().setFilter(txtBuscar.getText());
     grid.getDataProvider().refresh();
   } else if (event.getSource().equals(grid)) {
     if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER
         || event.getNativeEvent().getKeyCode() == KeyCodes.KEY_SPACE) {
       itemSelected();
     }
   }
 }