Class GridPro.EditColumn<T>

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.grid.Grid.Column<T>
com.vaadin.flow.component.gridpro.GridPro.EditColumn<T>
Type Parameters:
T - type of the underlying grid this column is compatible with
All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasElement, HasStyle, Serializable
Enclosing class:
GridPro<E>

@Tag("vaadin-grid-pro-edit-column") @NpmPackage(value="@vaadin/polymer-legacy-adapter", version="24.3.11") @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") public static class GridPro.EditColumn<T> extends Grid.Column<T>
Server-side component for the <vaadin-grid-edit-column> element.

Every added column sends data to the client side regardless of its visibility state. Don't add a new column at all or use Grid.removeColumn(Column) to avoid sending extra data.

See Also:
  • Field Details

    • grid

      protected final Grid<?> grid
  • Constructor Details

    • EditColumn

      public EditColumn(GridPro<T> grid, String columnId, Renderer<T> renderer)
      Constructs a new Column for use inside a Grid.
      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
  • Method Details

    • setItemUpdater

      protected GridPro.EditColumn<T> setItemUpdater(ItemUpdater<T,String> itemUpdater)
      Sets the itemUpdater function that will be called on item changed.
      Parameters:
      itemUpdater - the callback function that is called when item is changed. It receives two arguments: item and newValue.
      Returns:
      this column instance
    • getItemUpdater

      protected ItemUpdater<T,String> getItemUpdater()
      Gets the itemUpdater function that will be called on item changed.
      Returns:
      the instance of itemUpdater for this column
    • getEditorField

      protected HasValueAndElement getEditorField()
    • setEditorField

      protected void setEditorField(HasValueAndElement editorField)
    • setEditorType

      protected GridPro.EditColumn<T> setEditorType(EditorType type)
      Sets the type of the editor that is used for modifying cell value.
      Parameters:
      type - the type of the editor
      Returns:
      this column instance
      See Also:
    • getEditorType

      @Synchronize("editor-type-changed") protected String getEditorType()
      Gets the type of the editor that is used for modifying cell value.
      Returns:
      the editor type
    • setOptions

      protected GridPro.EditColumn<T> setOptions(List<String> options)
      Sets the list of options that is used for select type of the editor.
      Parameters:
      options - the list of options
      Returns:
      this column instance
    • getOptions

      @Synchronize("editor-options-changed") protected List<String> getOptions()
      Gets the list of options that is used for select type of the editor.
      Returns:
      the list of options
    • getValueProvider

      public ValueProvider<T,?> getValueProvider()
    • setValueProvider

      public void setValueProvider(ValueProvider<T,?> valueProvider)
    • getGrid

      public Grid<?> getGrid()
      Gets the owner of this column.
      Returns:
      the grid which owns this column
    • setVisible

      public void setVisible(boolean visible)
      Sets the component visibility value.

      When a component is set as invisible, all the updates of the component from the server to the client are blocked until the component is set as visible again.

      Invisible components don't receive any updates from the client-side. Unlike the server-side updates, client-side updates, if any, are discarded while the component is invisible, and are not transmitted to the server when the component is made visible.

      Note that column related data is sent to the client side even if the column is invisible. Use Grid.removeColumn(Column) to remove column (or don't add the column all) and avoid sending extra data.

      Overrides:
      setVisible in class Component
      Parameters:
      visible - the component visibility value
      See Also:
    • getHeaderText

      public String getHeaderText()
      Returns the header text of the column.
      Returns:
      the header text
    • setHeaderText

      protected void setHeaderText(String text)
    • getFooterText

      public String getFooterText()
      Returns the footer text of the column.
      Returns:
      the footer text
    • setFooterText

      protected void setFooterText(String text)
    • getHeaderComponent

      public Component getHeaderComponent()
      Returns the header component of the column.
      Returns:
      the header component
    • setHeaderComponent

      protected void setHeaderComponent(Component component)
    • getFooterComponent

      public Component getFooterComponent()
      Returns the footer component of the column.
      Returns:
      the footer component
    • setFooterComponent

      protected void setFooterComponent(Component component)
    • moveHeaderContent

      protected void moveHeaderContent(com.vaadin.flow.component.grid.AbstractColumn<?> otherColumn)
      Moves the current header content, either a text or a component, to a different column or column group. Also clears the content of this column.
      Parameters:
      otherColumn - the column or group to move the content to
    • moveFooterContent

      protected void moveFooterContent(com.vaadin.flow.component.grid.AbstractColumn<?> otherColumn)
      Moves the current footer content, either a text or a component, to a different column or column group. Also clears the content of this column.
      Parameters:
      otherColumn - the column or group to move the content to
    • updateSortingIndicators

      protected void updateSortingIndicators(boolean sortable)
      Updates this component to either have sorting indicators according to the sortable state of the underlying column, or removes the sorting indicators.
      Parameters:
      sortable - true to have sorting indicators if the column is sortable, false to not have sorting indicators
    • setSortingIndicators

      protected void setSortingIndicators(boolean sortingIndicators)
      Sets this component to show sorting indicators or not.
      Parameters:
      sortingIndicators - true to show sorting indicators, false to remove them
    • hasSortingIndicators

      protected boolean hasSortingIndicators()
    • getBottomChildColumns

      protected List<Grid.Column<?>> getBottomChildColumns()
      Gets recursively the child components of this component that are instances of Column.
      Returns:
      the Column children of this component
    • setResizable

      default Grid.Column<T> setResizable(boolean resizable)
      When set to true, the column is user-resizable. By default this is set to false.
      Parameters:
      resizable - whether to allow user resizing of this column
      Returns:
      this column, for method chaining
    • isResizable

      @Synchronize("resizable-changed") default boolean isResizable()
      Gets whether this column is user-resizable.
      Returns:
      whether this column is user-resizable
    • setFrozen

      default Grid.Column<T> setFrozen(boolean frozen)
      Sets this column's frozen state.

      Note: Columns are frozen in-place, freeze columns from left to right for a consistent outcome.

      Parameters:
      frozen - whether to freeze or unfreeze this column
      Returns:
      this column, for method chaining
    • isFrozen

      @Synchronize("frozen-changed") default boolean isFrozen()
      Gets the this column's frozen state.
      Returns:
      whether this column is frozen
    • setFrozenToEnd

      default Grid.Column<T> setFrozenToEnd(boolean frozenToEnd)
      Sets this column's frozen state.

      Note: Columns are frozen in-place, freeze columns from right to left for a consistent outcome.

      Parameters:
      frozenToEnd - whether to freeze or unfreeze this column
      Returns:
      this column, for method chaining
      Since:
      23.1
    • isFrozenToEnd

      @Synchronize("frozen-to-end-changed") default boolean isFrozenToEnd()
      Gets the this column's frozen state.
      Returns:
      whether this column is frozen to end
      Since:
      23.1
    • setTextAlign

      default Grid.Column<T> setTextAlign(ColumnTextAlign textAlign)
      Sets the column text align.
      Parameters:
      textAlign - the text alignment of the column. Setting it to null resets the alignment to the default value ColumnTextAlign.START.
      Returns:
      this column, for method chaining
    • getTextAlign

      @Synchronize("text-align-changed") default ColumnTextAlign getTextAlign()
      Gets the column text align. The default is ColumnTextAlign.START.
      Returns:
      the column text align, not null
    • setHeaderPartName

      default Grid.Column<T> setHeaderPartName(String headerPartName)
      Sets a custom part name for the header cell.
      Parameters:
      headerPartName - the part name to set
      Returns:
      this column, for method chaining
    • getHeaderPartName

      default String getHeaderPartName()
      Gets the custom part name of the header cell.
      Returns:
      the part name
    • setFooterPartName

      default Grid.Column<T> setFooterPartName(String footerPartName)
      Sets a custom part name for the footer cell.
      Parameters:
      footerPartName - the part name to set
      Returns:
      this column, for method chaining
    • getFooterPartName

      default String getFooterPartName()
      Gets the custom part name of the footer cell.
      Returns:
      the part name