Class GridPro.EditColumn<T>

    • Field Detail

      • grid

        protected final Grid<?> grid
      • headerTemplate

        protected Element headerTemplate
      • footerTemplate

        protected Element footerTemplate
    • Constructor Detail

      • 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 Detail

      • 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
      • 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:
        EditorType
      • 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
      • 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:
        Grid.removeColumn(Column)
      • setHeaderRenderer

        @Deprecated
        protected void setHeaderRenderer​(Renderer<?> renderer)
        Deprecated.
        since 23.3, internal usage of renderers for grid headers and footers will be removed in 24
        Only intended for internal use.
        Parameters:
        renderer - the new footer renderer
      • setFooterRenderer

        @Deprecated
        protected void setFooterRenderer​(Renderer<?> renderer)
        Deprecated.
        since 23.3, internal usage of renderers for grid headers and footers will be removed in 24
        Only intended for internal use.
        Parameters:
        renderer - the new footer renderer
      • 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)
      • getHeaderRenderer

        @Deprecated
        protected Renderer<?> getHeaderRenderer()
        Deprecated.
        since 23.3, internal usage of renderers for grid headers and footers will be removed in 24
        Only intended for internal use.
        Returns:
        the header renderer
      • getFooterRenderer

        @Deprecated
        protected Renderer<?> getFooterRenderer()
        Deprecated.
        since 23.3, internal usage of renderers for grid headers and footers will be removed in 24
        Only intended for internal use.
        Returns:
        the footer renderer
      • moveHeaderContent

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

        protected void moveFooterContent​(com.vaadin.flow.component.grid.AbstractColumn<?> otherColumn)
      • 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()
      • addGridSorter

        protected String addGridSorter​(String templateInnerHtml)
      • 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

        public default 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")
        public default boolean isResizable()
        Gets whether this column is user-resizable.
        Returns:
        whether this column is user-resizable
      • setFrozen

        public default 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")
        public default boolean isFrozen()
        Gets the this column's frozen state.
        Returns:
        whether this column is frozen
      • setFrozenToEnd

        public default 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")
        public default boolean isFrozenToEnd()
        Gets the this column's frozen state.
        Returns:
        whether this column is frozen to end
        Since:
        23.1
      • setTextAlign

        public default 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