Package io.jmix.flowui.component.grid
Interface EnhancedDataGrid<T>
- All Known Subinterfaces:
EnhancedTreeDataGrid<T>
- All Known Implementing Classes:
AbstractGroupDataGridAdapter,DataGrid,GroupDataGridAdapter,TreeDataGrid
@NullMarked
public interface EnhancedDataGrid<T>
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDefines the position of aggregation row. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAggregation(com.vaadin.flow.component.grid.Grid.Column<T> column, AggregationInfo info) Add an aggregation info in order to perform aggregation for column.addColumn(MetaPropertyPath metaPropertyPath) addColumn(String key, MetaPropertyPath metaPropertyPath) @Nullable DataGridColumn<T> getColumnByMetaPropertyPath(MetaPropertyPath metaPropertyPath) @Nullable MetaPropertyPathgetColumnMetaPropertyPath(com.vaadin.flow.component.grid.Grid.Column<T> column) @Nullable String@Nullable Function<DataGridSortContext<T>, DataGridSort> Retrieves the delegate function responsible for building the sorting configuration of theGrid.booleanbooleanvoidsetAggregatable(boolean aggregatable) Set to true if aggregation should be enabled.voidSets aggregation row position.voidsetHeaderFilterApplyShortcut(@Nullable String shortcut) Sets a shortcut combination for applyingDataGridHeaderFilter.voidsetSortBuilderDelegate(@Nullable Function<DataGridSortContext<T>, DataGridSort> delegate) Sets the delegate for building the sorting configuration of theGrid.
-
Method Details
-
getColumnMetaPropertyPath
@Nullable MetaPropertyPath getColumnMetaPropertyPath(com.vaadin.flow.component.grid.Grid.Column<T> column) -
getColumnByMetaPropertyPath
- Parameters:
metaPropertyPath-MetaPropertyPaththat refers to the column- Returns:
DataGridColumnthat is bound to the passedmetaPropertyPath
-
addColumn
-
addColumn
-
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
Sets aggregation row position. Default value isEnhancedDataGrid.AggregationPosition.BOTTOM.- Parameters:
position- position:EnhancedDataGrid.AggregationPosition.TOPorEnhancedDataGrid.AggregationPosition.BOTTOM
-
addAggregation
Add an aggregation info in order to perform aggregation for column.- Parameters:
column- column for aggregationinfo- aggregation info- See Also:
-
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
Sets a shortcut combination for applyingDataGridHeaderFilter.- 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 theGrid.- Returns:
- a delegate function for sorting operations or
nullif no delegate is set
-
setSortBuilderDelegate
Sets the delegate for building the sorting configuration of theGrid.The
DataGridSortContextcontains sorting instructions from the grid. TheDataGridSortobject represents the in-memory and persistent sorting to be applied.Use
DataGridSortBuilderto 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
-