Class GridPro.EditColumn<T>
- Type Parameters:
T- type of the underlying grid this column is compatible with
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasElement,HasStyle,Serializable
<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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<Grid.Column<?>>Gets recursively the child components of this component that are instances of Column.protected HasValueAndElementprotected StringGets the type of the editor that is used for modifying cell value.Returns the footer component of the column.default StringGets the custom part name of the footer cell.Returns the footer text of the column.Grid<?>getGrid()Gets the owner of this column.Returns the header component of the column.default StringGets the custom part name of the header cell.Returns the header text of the column.protected Stringprotected ItemUpdater<T,String> Gets the itemUpdater function that will be called on item changed.Gets the list of options that is used for select type of the editor.default ColumnTextAlignGets the column text align.ValueProvider<T,?> protected booleandefault booleanisFrozen()Gets the this column's frozen state.default booleanGets the this column's frozen state.default booleanGets whether this column is user-resizable.protected voidmoveFooterContent(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.protected voidmoveHeaderContent(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.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) default Grid.Column<T>setFooterPartName(String footerPartName) Sets a custom part name for the footer cell.protected voidsetFooterText(String text) default Grid.Column<T>setFrozen(boolean frozen) Sets this column's frozen state.default Grid.Column<T>setFrozenToEnd(boolean frozenToEnd) Sets this column's frozen state.protected voidsetHeaderComponent(Component component) default Grid.Column<T>setHeaderPartName(String headerPartName) Sets a custom part name for the header cell.protected 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 Grid.Column<T>setResizable(boolean resizable) When set totrue, the column is user-resizable.protected voidsetSortingIndicators(boolean sortingIndicators) Sets this component to show sorting indicators or not.default Grid.Column<T>setTextAlign(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, getKey, getPartNameGenerator, getRenderer, getSortOrder, getTooltipGenerator, getWidth, isAutoWidth, isRowHeader, isSortable, setAutoWidth, setClassNameGenerator, setComparator, setComparator, setEditorComponent, setEditorComponent, setFlexGrow, setFooter, setFooter, setHeader, setHeader, setKey, setPartNameGenerator, setRenderer, setRowHeader, setSortable, setSortOrderProvider, setSortProperty, 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
-
Field Details
-
grid
-
-
Constructor Details
-
EditColumn
Constructs a new Column for use inside a Grid.- Parameters:
grid- the grid this column is attached tocolumnId- unique identifier of this columnrenderer- the renderer to use in this column, must not benull
-
-
Method Details
-
setItemUpdater
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
Gets the itemUpdater function that will be called on item changed.- Returns:
- the instance of itemUpdater for this column
-
getEditorField
-
setEditorField
-
setEditorType
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
Gets the type of the editor that is used for modifying cell value.- Returns:
- the editor type
-
setOptions
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
Gets the list of options that is used for select type of the editor.- Returns:
- the list of options
-
getValueProvider
-
setValueProvider
-
getInternalId
- Overrides:
getInternalIdin classGrid.Column<T>
-
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:
-
getHeaderText
Returns the header text of the column.- Returns:
- the header text
-
setHeaderText
-
getHeaderComponent
Returns the header component of the column.- Returns:
- the header component
-
setHeaderComponent
-
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
-
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
Gets recursively the child components of this component that are instances of Column.- Returns:
- the Column children of this component
-
setResizable
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
Gets whether this column is user-resizable.- Returns:
- whether this column is user-resizable
-
setFrozen
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
Gets the this column's frozen state.- Returns:
- whether this column is frozen
-
setFrozenToEnd
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
Gets the this column's frozen state.- Returns:
- whether this column is frozen to end
- Since:
- 23.1
-
setTextAlign
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
Gets the column text align. The default isColumnTextAlign.START.- Returns:
- the column text align, not
null
-
setHeaderPartName
Sets a custom part name for the header cell.- Parameters:
headerPartName- the part name to set- Returns:
- this column, for method chaining
-
getHeaderPartName
Gets the custom part name of the header cell.- Returns:
- the part name
-