Class GridResponsiveStep<T>
java.lang.Object
com.flowingcode.vaadin.addons.gridhelpers.GridResponsiveStep<T>
- Type Parameters:
T
- the data type for Grid
- All Implemented Interfaces:
Serializable
Class used in describing the responsive layouting behavior of a
Grid
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
A registration object for removing or configuring aGridResponsiveStep
listener. -
Method Summary
Modifier and TypeMethodDescriptionaddListener
(@NonNull com.vaadin.flow.function.SerializableConsumer<GridResponsiveStepEvent> listener) Adds a listener which is invoked when the layout changes because of grid resizing.int
Return the minimum width (in pixels) after which this responsive step is to be applied.hide
(com.vaadin.flow.component.grid.Grid.Column<?>... columnsToHide) Hide the given columns when this responsive step is applied.Hide the given columns when this responsive step is applied.hideAll()
Hide all the grid columns when this responsive step is applied.void
remove()
Remove this responsive step and update the Grid.setColumns
(com.vaadin.flow.component.grid.Grid.Column<?>... columnsToShow) Set the columns that should be visible when this responsive step is applied.setColumns
(List<com.vaadin.flow.component.grid.Grid.Column<T>> columnsToShow) Set the columns that should be visible when this responsive step is applied.<C extends com.vaadin.flow.component.Component>
GridResponsiveStep<T>setItemDetailsRenderer
(@NonNull com.vaadin.flow.function.SerializableFunction<T, C> componentFunction) Set the renderer to use for displaying the item details rows when this responsive step is applied.setItemDetailsRenderer
(com.vaadin.flow.data.renderer.Renderer<T> renderer) Set the renderer to use for displaying the item details rows when this responsive step is applied.show
(com.vaadin.flow.component.grid.Grid.Column<?>... columnsToShow) Show the given columns when this responsive step is applied.Show the given columns when this responsive step is applied.showAll()
Show all the grid columns when this responsive step is applied.
-
Method Details
-
getMinWidth
public int getMinWidth()Return the minimum width (in pixels) after which this responsive step is to be applied. -
setItemDetailsRenderer
public GridResponsiveStep<T> setItemDetailsRenderer(com.vaadin.flow.data.renderer.Renderer<T> renderer) Set the renderer to use for displaying the item details rows when this responsive step is applied.- Parameters:
renderer
- the renderer to use for displaying item details rows,null
to use no detail renderer- Returns:
- the instance of GridResponsiveStep for chaining method calls
- See Also:
-
Grid.setItemDetailsRenderer(Renderer)
-
setItemDetailsRenderer
public <C extends com.vaadin.flow.component.Component> GridResponsiveStep<T> setItemDetailsRenderer(@NonNull @NonNull com.vaadin.flow.function.SerializableFunction<T, C> componentFunction) Set the renderer to use for displaying the item details rows when this responsive step is applied.- Type Parameters:
C
- the type of component returned bycomponentFunction
- Parameters:
componentFunction
- the function to set item details with a Component- Returns:
- the instance of GridResponsiveStep for chaining method calls
- See Also:
-
Grid.setItemDetailsRenderer(Renderer)
-
setColumns
public GridResponsiveStep<T> setColumns(com.vaadin.flow.component.grid.Grid.Column<?>... columnsToShow) Set the columns that should be visible when this responsive step is applied.- Parameters:
columnsToShow
- columns that should be visible- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
setColumns
public GridResponsiveStep<T> setColumns(List<com.vaadin.flow.component.grid.Grid.Column<T>> columnsToShow) Set the columns that should be visible when this responsive step is applied.- Parameters:
columnsToShow
- columns that should be visible- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
show
Show the given columns when this responsive step is applied.- Parameters:
columnsToShow
- columns to show- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
show
public GridResponsiveStep<T> show(List<com.vaadin.flow.component.grid.Grid.Column<T>> columnsToShow) Show the given columns when this responsive step is applied.- Parameters:
columnsToShow
- the columns to show- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
hide
Hide the given columns when this responsive step is applied.- Parameters:
columnsToHide
- the columns to hide- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
hide
public GridResponsiveStep<T> hide(List<com.vaadin.flow.component.grid.Grid.Column<T>> columnsToHide) Hide the given columns when this responsive step is applied.- Parameters:
columnsToHide
- the columns to hide- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
hideAll
Hide all the grid columns when this responsive step is applied.- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
showAll
Show all the grid columns when this responsive step is applied.- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
addListener
public GridResponsiveStep.GridResponsiveStepListenerRegistration addListener(@NonNull @NonNull com.vaadin.flow.function.SerializableConsumer<GridResponsiveStepEvent> listener) Adds a listener which is invoked when the layout changes because of grid resizing. By default, the listener will be "non-cummulative" (i.e. it will only be fired when the exact step is selected).- Parameters:
listener
- to add- Returns:
- handle to unregister the listener or make it cummulative
- See Also:
-
remove
public void remove()Remove this responsive step and update the Grid.
-