T
- type of the underlying grid this column is compatible with@Tag(value="vaadin-grid-pro-edit-column") public static class GridPro.EditColumn<T> extends Grid.Column<T>
<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.
Modifier and Type | Field and Description |
---|---|
protected Element |
footerTemplate |
protected Grid<?> |
grid |
protected Element |
headerTemplate |
Constructor and Description |
---|
EditColumn(GridPro<T> grid,
String columnId,
Renderer<T> renderer)
Constructs a new Column for use inside a Grid.
|
Modifier and Type | Method and Description |
---|---|
protected String |
addGridSorter(String templateInnerHtml) |
protected List<Grid.Column<?>> |
getBottomChildColumns()
Gets recursively the child components of this component that are
instances of Column.
|
protected AbstractField |
getEditorField() |
protected String |
getEditorType()
Gets the type of the editor that is used for modifying cell value.
|
protected Renderer<?> |
getFooterRenderer() |
Grid<?> |
getGrid()
Gets the owner of this column.
|
protected Renderer<?> |
getHeaderRenderer() |
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 ColumnTextAlign |
getTextAlign()
Gets the column text align.
|
ValueProvider<T,?> |
getValueProvider() |
protected boolean |
hasSortingIndicators() |
default boolean |
isFrozen()
Gets the this column's frozen state.
|
default boolean |
isResizable()
Gets whether this column is user-resizable.
|
protected void |
setBaseHeaderTemplate(String headerTemplate) |
protected void |
setEditorField(AbstractField editorField) |
protected GridPro.EditColumn<T> |
setEditorType(EditorType type)
Sets the type of the editor that is used for modifying cell value.
|
protected void |
setFooterComponent(Component component) |
protected void |
setFooterRenderer(Renderer<?> renderer) |
protected void |
setFooterText(String text) |
default T |
setFrozen(boolean frozen)
Sets this column's frozen state.
|
protected void |
setHeaderComponent(Component component) |
protected void |
setHeaderRenderer(Renderer<?> renderer) |
protected void |
setHeaderText(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 T |
setResizable(boolean resizable)
When set to
true , the column is user-resizable. |
protected void |
setSortingIndicators(boolean sortingIndicators)
Sets this component to show sorting indicators or not.
|
default T |
setTextAlign(ColumnTextAlign textAlign)
Sets the column text align.
|
void |
setValueProvider(ValueProvider<T,?> valueProvider) |
void |
setVisible(boolean visible)
Sets the component visibility value.
|
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.
|
destroyDataGenerators, getBottomLevelColumn, getClassNameGenerator, getComparator, getEditorComponent, getElement, getFlexGrow, getInternalId, getKey, getRenderer, getSortOrder, getWidth, isAutoWidth, isSortable, setAutoWidth, setClassNameGenerator, setComparator, setComparator, setEditorComponent, setEditorComponent, setFlexGrow, setFooter, setFooter, setHeader, setHeader, setKey, setSortable, setSortOrderProvider, setSortProperty, setWidth
addListener, fireEvent, from, get, getChildren, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAttachListener
addDetachListener
protected final Grid<?> grid
protected Element headerTemplate
protected Element footerTemplate
protected GridPro.EditColumn<T> setItemUpdater(ItemUpdater<T,String> itemUpdater)
itemUpdater
- the callback function that is called when item is changed.
It receives two arguments: item and newValue.protected ItemUpdater<T,String> getItemUpdater()
protected AbstractField getEditorField()
protected void setEditorField(AbstractField editorField)
protected GridPro.EditColumn<T> setEditorType(EditorType type)
type
- the type of the editorEditorType
@Synchronize(value="editor-type-changed") protected String getEditorType()
protected GridPro.EditColumn<T> setOptions(List<String> options)
options
- the list of options@Synchronize(value="editor-options-changed") protected List<String> getOptions()
public ValueProvider<T,?> getValueProvider()
public void setValueProvider(ValueProvider<T,?> valueProvider)
public Grid<?> getGrid()
public void setVisible(boolean visible)
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.
setVisible
in class Component
visible
- the component visibility valueGrid.removeColumn(Column)
protected void setHeaderRenderer(Renderer<?> renderer)
protected void setFooterRenderer(Renderer<?> renderer)
protected void setHeaderText(String text)
protected void setFooterText(String text)
protected void setHeaderComponent(Component component)
protected void setFooterComponent(Component component)
protected Renderer<?> getHeaderRenderer()
protected Renderer<?> getFooterRenderer()
protected void updateSortingIndicators(boolean sortable)
sortable
- true
to have sorting indicators if the column is
sortable, false
to not have sorting indicatorsprotected void setSortingIndicators(boolean sortingIndicators)
sortingIndicators
- true
to show sorting indicators, false
to
remove themprotected boolean hasSortingIndicators()
protected void setBaseHeaderTemplate(String headerTemplate)
protected List<Grid.Column<?>> getBottomChildColumns()
public T setResizable(boolean resizable)
true
, the column is user-resizable. By default this
is set to false
.resizable
- whether to allow user resizing of this column@Synchronize(value="resizable-changed") public boolean isResizable()
public T setFrozen(boolean frozen)
Note: Columns are frozen in-place, freeze columns from left to right for a consistent outcome.
frozen
- whether to freeze or unfreeze this column@Synchronize(value="frozen-changed") public boolean isFrozen()
public T setTextAlign(ColumnTextAlign textAlign)
textAlign
- the text alignment of the column. Setting it to
null
resets the alignment to the default value
ColumnTextAlign.START
.@Synchronize(value="text-align-changed") public ColumnTextAlign getTextAlign()
ColumnTextAlign.START
.null
Copyright © 2025. All rights reserved.