Class EnhancedColumn<T>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.grid.Grid.Column<T>
com.vaadin.componentfactory.enhancedgrid.EnhancedColumn<T>
- Type Parameters:
T- type of the underlying grid this column is compatible with
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,com.vaadin.flow.router.BeforeEnterObserver,com.vaadin.flow.router.internal.BeforeEnterHandler,Serializable
@Uses(com.vaadin.flow.component.icon.Icon.class)
@JsModule("./src/enhanced-grid-sorter.js")
public class EnhancedColumn<T>
extends com.vaadin.flow.component.grid.Grid.Column<T>
implements com.vaadin.flow.router.BeforeEnterObserver
Column that extends setHeader methods to add a filter
button and a
filter component to perform column's filtering.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEnhancedColumn(EnhancedGrid<T> grid, String columnId, com.vaadin.flow.data.renderer.Renderer<T> renderer) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFilterButtonToHeader(com.vaadin.flow.component.Component headerComponent, com.vaadin.flow.component.HasValueAndElement<?, ? extends FilterFieldDto> filter) voidbeforeEnter(com.vaadin.flow.router.BeforeEnterEvent beforeEnterEvent) voidClear selected filter.protected List<com.vaadin.flow.component.grid.Grid.Column<?>> com.vaadin.flow.component.HasValueAndElement<?, ? extends FilterFieldDto> Returns the filter.com.vaadin.flow.component.Componentdefault Stringcom.vaadin.flow.component.grid.Grid<?> getGrid()com.vaadin.flow.component.Componentdefault Stringdefault com.vaadin.flow.component.grid.ColumnTextAligncom.vaadin.flow.function.ValueProvider<T, ?> Returns the value provider.booleanReturns if column is filteredprotected booleanbooleanReturn if column shows filter fielddefault booleanisFrozen()default booleandefault booleanprotected voidmoveFooterContent(com.vaadin.flow.component.grid.AbstractColumn<?> arg0) protected voidmoveHeaderContent(com.vaadin.flow.component.grid.AbstractColumn<?> arg0) protected void<V extends Comparable<? super V>>
EnhancedColumn<T> setComparator(com.vaadin.flow.function.ValueProvider<T, V> keyExtractor) setComparator(Comparator<T> comparator) protected voidsetFilterIcon(com.vaadin.flow.component.icon.Icon icon) protected voidsetFooterComponent(com.vaadin.flow.component.Component arg0) default com.vaadin.flow.component.grid.Grid.Column<T> setFooterPartName(String arg0) protected voidsetFooterText(String arg0) default com.vaadin.flow.component.grid.Grid.Column<T> setFrozen(boolean arg0) default com.vaadin.flow.component.grid.Grid.Column<T> setFrozenToEnd(boolean arg0) setHeader(com.vaadin.flow.component.Component headerComponent) setHeader(com.vaadin.flow.component.Component headerComponent, com.vaadin.flow.component.HasValueAndElement<?, ? extends FilterFieldDto> filter) Set the header of this column to the given component and add a filter button and afilter componentto perform column's filtering.setHeader(String labelText, com.vaadin.flow.component.HasValueAndElement<?, ? extends FilterFieldDto> filter) Set the header of this column to the given label text and add a filter button and afilter componentto perform column's filtering.protected voidsetHeaderComponent(com.vaadin.flow.component.Component component) default com.vaadin.flow.component.grid.Grid.Column<T> setHeaderPartName(String arg0) protected voidsetHeaderText(String arg0) setResizable(boolean resizable) setSortable(boolean sortable) protected voidsetSortingIndicators(boolean arg0) setSortOrderProvider(com.vaadin.flow.component.grid.SortOrderProvider provider) setSortProperty(String... properties) default com.vaadin.flow.component.grid.Grid.Column<T> setTextAlign(com.vaadin.flow.component.grid.ColumnTextAlign arg0) voidsetValueProvider(com.vaadin.flow.function.ValueProvider<T, ?> valueProvider) Sets the value provider.voidsetVisible(boolean arg0) protected voidprotected voidupdateSortingIndicators(boolean arg0) Methods inherited from class com.vaadin.flow.component.grid.Grid.Column
destroyDataGenerators, getBottomLevelColumn, getComparator, getEditorComponent, getElement, getFlexGrow, getInternalId, getKey, getPartNameGenerator, getRenderer, getSortOrder, getTooltipGenerator, getWidth, isAutoWidth, isRowHeader, isSortable, setAutoWidth, setEditorComponent, setEditorComponent, setFlexGrow, setFooter, setFooter, setPartNameGenerator, setRenderer, setRowHeader, setTooltipGenerator, setWidthMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
EnhancedColumn
public EnhancedColumn(EnhancedGrid<T> grid, String columnId, com.vaadin.flow.data.renderer.Renderer<T> renderer) - Parameters:
grid- the grid this column is attached tocolumnId- unique identifier of this columnrenderer- the renderer to use in this column, must not benull- See Also:
-
-
Method Details
-
setHeader
public EnhancedColumn<T> setHeader(String labelText, com.vaadin.flow.component.HasValueAndElement<?, ? extends FilterFieldDto> filter) Set the header of this column to the given label text and add a filter button and afilter componentto perform column's filtering.- Parameters:
labelText- the label text to setfilter- the filter to set- Returns:
- this column
-
setHeader
public EnhancedColumn<T> setHeader(com.vaadin.flow.component.Component headerComponent, com.vaadin.flow.component.HasValueAndElement<?, ? extends FilterFieldDto> filter) Set the header of this column to the given component and add a filter button and afilter componentto perform column's filtering.- Parameters:
headerComponent- the header component to setfilter- the filter to set- Returns:
- this column
-
setHeader
- Overrides:
setHeaderin classcom.vaadin.flow.component.grid.Grid.Column<T>- Parameters:
headerComponent- the header component to set- Returns:
- this column
- See Also:
-
renderHeader
protected void renderHeader() -
setHeader
- Overrides:
setHeaderin classcom.vaadin.flow.component.grid.Grid.Column<T>- Parameters:
labelText- the label text to set- Returns:
- this column
- See Also:
-
addFilterButtonToHeader
protected void addFilterButtonToHeader(com.vaadin.flow.component.Component headerComponent, com.vaadin.flow.component.HasValueAndElement<?, ? extends FilterFieldDto> filter) -
getFilter
Returns the filter.- Returns:
- the filter
-
updateFilterButtonStyle
protected void updateFilterButtonStyle() -
getValueProvider
Returns the value provider.- Returns:
- the value provider
-
setValueProvider
Sets the value provider.- Parameters:
valueProvider- the value provider to set
-
clearFilter
public void clearFilter()Clear selected filter. -
setSortProperty
- Overrides:
setSortPropertyin classcom.vaadin.flow.component.grid.Grid.Column<T>- See Also:
-
setSortOrderProvider
public EnhancedColumn<T> setSortOrderProvider(com.vaadin.flow.component.grid.SortOrderProvider provider) - Overrides:
setSortOrderProviderin classcom.vaadin.flow.component.grid.Grid.Column<T>- See Also:
-
setSortable
- Overrides:
setSortablein classcom.vaadin.flow.component.grid.Grid.Column<T>- See Also:
-
setResizable
- See Also:
-
setComparator
public <V extends Comparable<? super V>> EnhancedColumn<T> setComparator(com.vaadin.flow.function.ValueProvider<T, V> keyExtractor) - Overrides:
setComparatorin classcom.vaadin.flow.component.grid.Grid.Column<T>- See Also:
-
setComparator
- Overrides:
setComparatorin classcom.vaadin.flow.component.grid.Grid.Column<T>- See Also:
-
setHeaderComponent
protected void setHeaderComponent(com.vaadin.flow.component.Component component) -
isFilterable
public boolean isFilterable()Return if column shows filter field- Returns:
- true if column shows filter field
-
hasFilterSelected
public boolean hasFilterSelected()Returns if column is filtered- Returns:
- true if column is filtered
-
setFilterIcon
protected void setFilterIcon(com.vaadin.flow.component.icon.Icon icon) -
setKey
- Overrides:
setKeyin classcom.vaadin.flow.component.grid.Grid.Column<T>- See Also:
-
beforeEnter
public void beforeEnter(com.vaadin.flow.router.BeforeEnterEvent beforeEnterEvent) - Specified by:
beforeEnterin interfacecom.vaadin.flow.router.internal.BeforeEnterHandler
-
getGrid
public com.vaadin.flow.component.grid.Grid<?> getGrid() -
setVisible
public void setVisible(boolean arg0) - Overrides:
setVisiblein classcom.vaadin.flow.component.Component
-
getHeaderText
-
setHeaderText
-
getHeaderComponent
public com.vaadin.flow.component.Component getHeaderComponent() -
moveHeaderContent
protected void moveHeaderContent(com.vaadin.flow.component.grid.AbstractColumn<?> arg0) -
updateSortingIndicators
protected void updateSortingIndicators(boolean arg0) -
setSortingIndicators
protected void setSortingIndicators(boolean arg0) -
hasSortingIndicators
protected boolean hasSortingIndicators() -
getBottomChildColumns
-
isResizable
@Synchronize("resizable-changed") default boolean isResizable() -
setFrozen
-
isFrozen
@Synchronize("frozen-changed") default boolean isFrozen() -
setFrozenToEnd
-
isFrozenToEnd
@Synchronize("frozen-to-end-changed") default boolean isFrozenToEnd() -
setTextAlign
default com.vaadin.flow.component.grid.Grid.Column<T> setTextAlign(com.vaadin.flow.component.grid.ColumnTextAlign arg0) -
getTextAlign
@Synchronize("text-align-changed") default com.vaadin.flow.component.grid.ColumnTextAlign getTextAlign() -
setHeaderPartName
-
getHeaderPartName
-