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 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 to
      columnId - unique identifier of this column
      renderer - the renderer to use in this column, must not be null
      See Also:
      • Column(Grid, String, Renderer)
  • 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 a filter component to perform column's filtering.
      Parameters:
      labelText - the label text to set
      filter - 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 a filter component to perform column's filtering.
      Parameters:
      headerComponent - the header component to set
      filter - the filter to set
      Returns:
      this column
    • setHeader

      public EnhancedColumn<T> setHeader(com.vaadin.flow.component.Component headerComponent)
      Overrides:
      setHeader in class com.vaadin.flow.component.grid.Grid.Column<T>
      Parameters:
      headerComponent - the header component to set
      Returns:
      this column
      See Also:
      • Grid.Column.setHeader(Component)
    • renderHeader

      protected void renderHeader()
    • setHeader

      public EnhancedColumn<T> setHeader(String labelText)
      Overrides:
      setHeader in class com.vaadin.flow.component.grid.Grid.Column<T>
      Parameters:
      labelText - the label text to set
      Returns:
      this column
      See Also:
      • Grid.Column.setHeader(String)
    • addFilterButtonToHeader

      protected void addFilterButtonToHeader(com.vaadin.flow.component.Component headerComponent, com.vaadin.flow.component.HasValueAndElement<?,? extends FilterFieldDto> filter)
    • getFilter

      public com.vaadin.flow.component.HasValueAndElement<?,? extends FilterFieldDto> getFilter()
      Returns the filter.
      Returns:
      the filter
    • updateFilterButtonStyle

      protected void updateFilterButtonStyle()
    • getValueProvider

      public com.vaadin.flow.function.ValueProvider<T,?> getValueProvider()
      Returns the value provider.
      Returns:
      the value provider
    • setValueProvider

      public void setValueProvider(com.vaadin.flow.function.ValueProvider<T,?> valueProvider)
      Sets the value provider.
      Parameters:
      valueProvider - the value provider to set
    • clearFilter

      public void clearFilter()
      Clear selected filter.
    • setSortProperty

      public EnhancedColumn<T> setSortProperty(String... properties)
      Overrides:
      setSortProperty in class com.vaadin.flow.component.grid.Grid.Column<T>
      See Also:
      • Grid.Column.setSortProperty(String...)
    • setSortOrderProvider

      public EnhancedColumn<T> setSortOrderProvider(com.vaadin.flow.component.grid.SortOrderProvider provider)
      Overrides:
      setSortOrderProvider in class com.vaadin.flow.component.grid.Grid.Column<T>
      See Also:
      • Grid.Column.setSortOrderProvider(SortOrderProvider)
    • setSortable

      public EnhancedColumn<T> setSortable(boolean sortable)
      Overrides:
      setSortable in class com.vaadin.flow.component.grid.Grid.Column<T>
      See Also:
      • Grid.Column.setSortable(boolean)
    • setResizable

      public EnhancedColumn<T> setResizable(boolean resizable)
      See Also:
      • ColumnBase.setResizable(boolean)
    • setComparator

      public <V extends Comparable<? super V>> EnhancedColumn<T> setComparator(com.vaadin.flow.function.ValueProvider<T,V> keyExtractor)
      Overrides:
      setComparator in class com.vaadin.flow.component.grid.Grid.Column<T>
      See Also:
      • Grid.Column.setComparator(ValueProvider)
    • setComparator

      public EnhancedColumn<T> setComparator(Comparator<T> comparator)
      Overrides:
      setComparator in class com.vaadin.flow.component.grid.Grid.Column<T>
      See Also:
      • Grid.Column.setComparator(Comparator)
    • 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

      public EnhancedColumn<T> setKey(String key)
      Overrides:
      setKey in class com.vaadin.flow.component.grid.Grid.Column<T>
      See Also:
      • Grid.Column.setKey(String)
    • beforeEnter

      public void beforeEnter(com.vaadin.flow.router.BeforeEnterEvent beforeEnterEvent)
      Specified by:
      beforeEnter in interface com.vaadin.flow.router.internal.BeforeEnterHandler
    • getGrid

      public com.vaadin.flow.component.grid.Grid<?> getGrid()
    • setVisible

      public void setVisible(boolean arg0)
      Overrides:
      setVisible in class com.vaadin.flow.component.Component
    • getHeaderText

      public String getHeaderText()
    • setHeaderText

      protected void setHeaderText(String arg0)
    • getFooterText

      public String getFooterText()
    • setFooterText

      protected void setFooterText(String arg0)
    • getHeaderComponent

      public com.vaadin.flow.component.Component getHeaderComponent()
    • getFooterComponent

      public com.vaadin.flow.component.Component getFooterComponent()
    • setFooterComponent

      protected void setFooterComponent(com.vaadin.flow.component.Component arg0)
    • moveHeaderContent

      protected void moveHeaderContent(com.vaadin.flow.component.grid.AbstractColumn<?> arg0)
    • moveFooterContent

      protected void moveFooterContent(com.vaadin.flow.component.grid.AbstractColumn<?> arg0)
    • updateSortingIndicators

      protected void updateSortingIndicators(boolean arg0)
    • setSortingIndicators

      protected void setSortingIndicators(boolean arg0)
    • hasSortingIndicators

      protected boolean hasSortingIndicators()
    • getBottomChildColumns

      protected List<com.vaadin.flow.component.grid.Grid.Column<?>> getBottomChildColumns()
    • isResizable

      @Synchronize("resizable-changed") default boolean isResizable()
    • setFrozen

      default com.vaadin.flow.component.grid.Grid.Column<T> setFrozen(boolean arg0)
    • isFrozen

      @Synchronize("frozen-changed") default boolean isFrozen()
    • setFrozenToEnd

      default com.vaadin.flow.component.grid.Grid.Column<T> setFrozenToEnd(boolean arg0)
    • 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

      default com.vaadin.flow.component.grid.Grid.Column<T> setHeaderPartName(String arg0)
    • getHeaderPartName

      default String getHeaderPartName()
    • setFooterPartName

      default com.vaadin.flow.component.grid.Grid.Column<T> setFooterPartName(String arg0)
    • getFooterPartName

      default String getFooterPartName()