Interface EnhancedGroupDataGrid<T>
- All Known Implementing Classes:
GroupDataGrid
@NullMarked
public interface EnhancedGroupDataGrid<T>
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDefines the position of aggregation row. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAggregation(Grid.Column<T> column, AggregationInfo info) Add aggregation info to perform aggregation for column.addColumn(MetaPropertyPath metaPropertyPath) Adds a column by the meta-property path.addColumn(String key, MetaPropertyPath metaPropertyPath) Adds a column by the meta-property path and specified key.@Nullable DataGridColumn<T> getColumnByMetaPropertyPath(MetaPropertyPath metaPropertyPath) @Nullable MetaPropertyPathgetColumnMetaPropertyPath(Grid.Column<T> column) @Nullable Function<GroupDataGridSortContext<T>, DataGridSort> booleanbooleanvoidsetAggregatable(boolean aggregatable) Set to true if aggregation should be enabled.voidSets aggregation row position.voidsetSortBuilderDelegate(@Nullable Function<GroupDataGridSortContext<T>, DataGridSort> delegate) Sets the delegate for building the sorting configuration of theGrid.
-
Method Details
-
getColumnMetaPropertyPath
- Parameters:
column- column to get the meta-property path for- Returns:
MetaPropertyPaththat refers to the column ornullif the column is not bound to any property
-
getColumnByMetaPropertyPath
- Parameters:
metaPropertyPath-MetaPropertyPaththat refers to the column- Returns:
DataGridColumnthat is bound to the passedmetaPropertyPath
-
addColumn
Adds a column by the meta-property path.- Parameters:
metaPropertyPath- meta-property path to add a column- Returns:
- added column
-
addColumn
Adds a column by the meta-property path and specified key. The key is used to identify the column, seeGrid.getColumnByKey(String).- Parameters:
key- column keymetaPropertyPath- meta-property path to add a column- Returns:
- added column
-
isEditorCreated
boolean isEditorCreated()- Returns:
trueif the editor is created
-
isAggregatable
boolean isAggregatable()- Returns:
trueif DataGrid is aggregatable
-
setAggregatable
void setAggregatable(boolean aggregatable) Set to true if aggregation should be enabled. The default value isfalse.- Parameters:
aggregatable- whether to aggregate DataGrid columns
-
getAggregationPosition
EnhancedGroupDataGrid.AggregationPosition getAggregationPosition()- Returns:
- return aggregation row position
-
setAggregationPosition
Sets aggregation row position. Default value isEnhancedGroupDataGrid.AggregationPosition.BOTTOM.- Parameters:
position- position:EnhancedGroupDataGrid.AggregationPosition.TOPorEnhancedGroupDataGrid.AggregationPosition.BOTTOM
-
addAggregation
Add aggregation info to perform aggregation for column.- Parameters:
column- column for aggregationinfo- 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
Gridornullif not set
-
setSortBuilderDelegate
Sets the delegate for building the sorting configuration of theGrid.The
GroupDataGridSortContextcontains sorting instructions from the grid. TheDataGridSortobject represents the in-memory and persistent sorting to be applied.Use
GroupDataGridSortBuilderto 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
-