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,Serializable
@Tag("vaadin-grid-pro-edit-column") @NpmPackage(value="@vaadin/polymer-legacy-adapter", version="23.3.30") @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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ElementfooterTemplateprotected Grid<?>gridprotected ElementheaderTemplate
-
Method Summary
All Methods Instance Methods Concrete Methods Default Methods Deprecated Methods Modifier and Type Method Description protected StringaddGridSorter(String templateInnerHtml)protected List<Grid.Column<?>>getBottomChildColumns()Gets recursively the child components of this component that are instances of Column.protected HasValueAndElementgetEditorField()protected StringgetEditorType()Gets the type of the editor that is used for modifying cell value.ComponentgetFooterComponent()Returns the footer component of the column.protected Renderer<?>getFooterRenderer()Deprecated.since 23.3, internal usage of renderers for grid headers and footers will be removed in 24StringgetFooterText()Returns the footer text of the column.Grid<?>getGrid()Gets the owner of this column.ComponentgetHeaderComponent()Returns the header component of the column.protected Renderer<?>getHeaderRenderer()Deprecated.since 23.3, internal usage of renderers for grid headers and footers will be removed in 24StringgetHeaderText()Returns the header text of the column.protected ItemUpdater<T,String>getItemUpdater()Gets the itemUpdater function that will be called on item changed.protected List<String>getOptions()Gets the list of options that is used for select type of the editor.default ColumnTextAligngetTextAlign()Gets the column text align.ValueProvider<T,?>getValueProvider()protected booleanhasSortingIndicators()default booleanisFrozen()Gets the this column's frozen state.default booleanisFrozenToEnd()Gets the this column's frozen state.default booleanisResizable()Gets whether this column is user-resizable.protected voidmoveFooterContent(com.vaadin.flow.component.grid.AbstractColumn<?> otherColumn)protected voidmoveHeaderContent(com.vaadin.flow.component.grid.AbstractColumn<?> otherColumn)protected voidsetEditorField(HasValueAndElement editorField)protected GridPro.EditColumn<T>setEditorType(EditorType type)Sets the type of the editor that is used for modifying cell value.protected voidsetFooterComponent(Component component)protected voidsetFooterRenderer(Renderer<?> renderer)Deprecated.since 23.3, internal usage of renderers for grid headers and footers will be removed in 24protected voidsetFooterText(String text)default TsetFrozen(boolean frozen)Sets this column's frozen state.default TsetFrozenToEnd(boolean frozenToEnd)Sets this column's frozen state.protected voidsetHeaderComponent(Component component)protected voidsetHeaderRenderer(Renderer<?> renderer)Deprecated.since 23.3, internal usage of renderers for grid headers and footers will be removed in 24protected voidsetHeaderText(String text)protected GridPro.EditColumn<T>setItemUpdater(ItemUpdater<T,String> itemUpdater)Sets the itemUpdater function that will be called on item changed.protected GridPro.EditColumn<T>setOptions(List<String> options)Sets the list of options that is used for select type of the editor.default TsetResizable(boolean resizable)When set totrue, the column is user-resizable.protected voidsetSortingIndicators(boolean sortingIndicators)Sets this component to show sorting indicators or not.default TsetTextAlign(ColumnTextAlign textAlign)Sets the column text align.voidsetValueProvider(ValueProvider<T,?> valueProvider)voidsetVisible(boolean visible)Sets the component visibility value.protected voidupdateSortingIndicators(boolean sortable)Updates this component to either have sorting indicators according to the sortable state of the underlying column, or removes the sorting indicators.-
Methods inherited from class com.vaadin.flow.component.grid.Grid.Column
destroyDataGenerators, getBottomLevelColumn, getClassNameGenerator, getComparator, getEditorComponent, getElement, getFlexGrow, getInternalId, getKey, getRenderer, getSortOrder, getTooltipGenerator, getWidth, isAutoWidth, isSortable, setAutoWidth, setClassNameGenerator, setComparator, setComparator, setEditorComponent, setEditorComponent, setFlexGrow, setFooter, setFooter, setHeader, setHeader, setKey, setSortable, setSortOrderProvider, setSortProperty, setTooltipGenerator, setWidth
-
Methods 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, scrollIntoView, set, setElement, setId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
-
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
-
-
-
-
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
-
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:
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
-
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:
setVisiblein classComponent- 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 24Only 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 24Only 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 24Only 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 24Only 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-trueto have sorting indicators if the column is sortable,falseto not have sorting indicators
-
setSortingIndicators
protected void setSortingIndicators(boolean sortingIndicators)
Sets this component to show sorting indicators or not.- Parameters:
sortingIndicators-trueto show sorting indicators,falseto 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
public default T setResizable(boolean resizable)
When set totrue, the column is user-resizable. By default this is set tofalse.- 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 tonullresets the alignment to the default valueColumnTextAlign.START.- Returns:
- this column, for method chaining
-
getTextAlign
@Synchronize("text-align-changed") public default ColumnTextAlign getTextAlign()
Gets the column text align. The default isColumnTextAlign.START.- Returns:
- the column text align, not
null
-
-