Class DataGrid.EditorOpenEvent<E>

All Implemented Interfaces:
Serializable
Enclosing interface:
DataGrid<E>

public static class DataGrid.EditorOpenEvent<E> extends DataGrid.AbstractDataGridEditorEvent<E>
An event that is fired before the DataGrid editor is opened. Provides access to the components that will be used in the editor, giving the possibility to change their values programmatically.

Sample usage:


 dataGrid.addEditorOpenListener(event -> {
      Map<String, Field> fields = event.getFields();
      Field field1 = fields.get("field1");
      Field field2 = fields.get("field2");
      Field sum = fields.get("sum");

      ValueChangeListener valueChangeListener = e ->
      sum.setValue((int) field1.getValue() + (int) field2.getValue());
      field1.addValueChangeListener(valueChangeListener);
      field2.addValueChangeListener(valueChangeListener);
 });
 
See Also:
  • Constructor Details

    • EditorOpenEvent

      public EditorOpenEvent(DataGrid component, E item, Map<String,Field> fields)
      Parameters:
      component - the DataGrid from which this event originates
      item - the editing item
      fields - the map, where key - DataGrid column's id and value - the field that is used in the editor for this column