Interface EnhancedDataGrid<T>

All Known Subinterfaces:
EnhancedTreeDataGrid<T>
All Known Implementing Classes:
AbstractGroupDataGridAdapter, DataGrid, GroupDataGridAdapter, TreeDataGrid

@NullMarked public interface EnhancedDataGrid<T>
  • Method Details

    • getColumnMetaPropertyPath

      @Nullable MetaPropertyPath getColumnMetaPropertyPath(com.vaadin.flow.component.grid.Grid.Column<T> column)
    • getColumnByMetaPropertyPath

      @Nullable DataGridColumn<T> getColumnByMetaPropertyPath(MetaPropertyPath metaPropertyPath)
      Parameters:
      metaPropertyPath - MetaPropertyPath that refers to the column
      Returns:
      DataGridColumn that is bound to the passed metaPropertyPath
    • addColumn

      DataGridColumn<T> addColumn(MetaPropertyPath metaPropertyPath)
    • addColumn

      DataGridColumn<T> addColumn(String key, MetaPropertyPath metaPropertyPath)
    • isEditorCreated

      boolean isEditorCreated()
    • isAggregatable

      boolean isAggregatable()
      Returns:
      true if DataGrid is aggregatable
    • setAggregatable

      void setAggregatable(boolean aggregatable)
      Set to true if aggregation should be enabled. Default value is false.
      Parameters:
      aggregatable - whether to aggregate DataGrid columns
    • getAggregationPosition

      EnhancedDataGrid.AggregationPosition getAggregationPosition()
      Returns:
      return aggregation row position
    • setAggregationPosition

      void setAggregationPosition(EnhancedDataGrid.AggregationPosition position)
      Sets aggregation row position. Default value is EnhancedDataGrid.AggregationPosition.BOTTOM.
      Parameters:
      position - position: EnhancedDataGrid.AggregationPosition.TOP or EnhancedDataGrid.AggregationPosition.BOTTOM
    • addAggregation

      void addAggregation(com.vaadin.flow.component.grid.Grid.Column<T> column, AggregationInfo info)
      Add an aggregation info in order to perform aggregation for column.
      Parameters:
      column - column for aggregation
      info - aggregation info
      See Also:
    • getAggregationResults

      Map<com.vaadin.flow.component.grid.Grid.Column<T>,Object> getAggregationResults()
      Returns:
      aggregated values for columns
    • getContextMenu

      JmixGridContextMenu<T> getContextMenu()
      Returns:
      context menu instance attached to the grid
    • getHeaderFilterApplyShortcut

      @Nullable String getHeaderFilterApplyShortcut()
      Returns:
      a shortcut combination for applying DataGridHeaderFilter
    • setHeaderFilterApplyShortcut

      void setHeaderFilterApplyShortcut(@Nullable String shortcut)
      Sets a shortcut combination for applying DataGridHeaderFilter.
      Parameters:
      shortcut - shortcut combination (e.g. "CONTROL-ENTER")
    • getSortBuilderDelegate

      @Nullable Function<DataGridSortContext<T>,DataGridSort> getSortBuilderDelegate()
      Retrieves the delegate function responsible for building the sorting configuration of the Grid.
      Returns:
      a delegate function for sorting operations or null if no delegate is set
    • setSortBuilderDelegate

      void setSortBuilderDelegate(@Nullable Function<DataGridSortContext<T>,DataGridSort> delegate)
      Sets the delegate for building the sorting configuration of the Grid.

      The DataGridSortContext contains sorting instructions from the grid. The DataGridSort object represents the in-memory and persistent sorting to be applied.

      Use DataGridSortBuilder to easily build and replace the sorting configuration.

      For instance:

       @Install(to = "customersGrid", subject = "sortBuilderDelegate")
       private DataGridSort sortBuilderDelegate(final DataGridSortContext<Customer> context) {
           return DataGridSortBuilder.create(context)
                   .replaceSort("loyaltyPointsCalc", "{E}.loyaltyPoints", ((o1, o2) -> {
                       int calc1 = Integer.parseInt(o1.getLoyaltyPointsCalc());
                       int calc2 = Integer.parseInt(o2.getLoyaltyPointsCalc());
                       return Integer.compare(calc1, calc2);
                   }))
                   .build();
       }
       
      Parameters:
      delegate - a function to set