Interface EnhancedGroupDataGrid<T>

All Known Implementing Classes:
GroupDataGrid

@NullMarked public interface EnhancedGroupDataGrid<T>
  • Method Details

    • getColumnMetaPropertyPath

      @Nullable MetaPropertyPath getColumnMetaPropertyPath(Grid.Column<T> column)
      Parameters:
      column - column to get the meta-property path for
      Returns:
      MetaPropertyPath that refers to the column or null if the column is not bound to any property
    • 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)
      Adds a column by the meta-property path.
      Parameters:
      metaPropertyPath - meta-property path to add a column
      Returns:
      added column
    • addColumn

      DataGridColumn<T> addColumn(String key, MetaPropertyPath metaPropertyPath)
      Adds a column by the meta-property path and specified key. The key is used to identify the column, see Grid.getColumnByKey(String).
      Parameters:
      key - column key
      metaPropertyPath - meta-property path to add a column
      Returns:
      added column
    • isEditorCreated

      boolean isEditorCreated()
      Returns:
      true if the editor is created
    • isAggregatable

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

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

      Returns:
      return aggregation row position
    • setAggregationPosition

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

      void addAggregation(Grid.Column<T> column, AggregationInfo info)
      Add aggregation info to perform aggregation for column.
      Parameters:
      column - column for aggregation
      info - aggregation info
      See Also:
    • getAggregationResults

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

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

      @Nullable Function<GroupDataGridSortContext<T>,DataGridSort> getSortBuilderDelegate()
      Returns:
      the delegate for building the sorting configuration of the Grid or null if not set
    • setSortBuilderDelegate

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

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

      Use GroupDataGridSortBuilder to easily build and replace the sorting configuration.

      For instance:

       @Install(to = "customersGrid", subject = "sortBuilderDelegate")
       private DataGridSort sortBuilderDelegate(final DataGridSortContext<Customer> context) {
           return GroupDataGridSortBuilder.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