Class GridPro<E>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.grid.Grid<E>
com.vaadin.flow.component.gridpro.GridPro<E>
- All Implemented Interfaces:
AttachNotifier
,BlurNotifier<Grid<E>>
,DetachNotifier
,Focusable<Grid<E>>
,FocusNotifier<Grid<E>>
,HasElement
,HasEnabled
,HasSize
,HasStyle
,HasTheme
,SortEvent.SortNotifier<Grid<E>,
,GridSortOrder<E>> HasDataGenerators<E>
,HasDataView<E,
,Void, GridDataView<E>> HasLazyDataView<E,
,Void, GridLazyDataView<E>> HasListDataView<E,
,GridListDataView<E>> Serializable
@Tag("vaadin-grid-pro")
@NpmPackage(value="@vaadin/polymer-legacy-adapter",version="24.3.22") @NpmPackage(value="@vaadin/grid-pro",version="24.3.22")
@JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/grid-pro/src/vaadin-grid-pro.js") @JsModule("@vaadin/grid-pro/src/vaadin-grid-pro-edit-column.js") @JsModule("./gridProConnector.js")
public class GridPro<E>
extends Grid<E>
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Event fired when the user starts to edit an existing item.static class
Server-side component for the<vaadin-grid-edit-column>
element.static class
Event fired when the user has edited an existing item.Nested classes/interfaces inherited from class com.vaadin.flow.component.grid.Grid
Grid.AbstractGridExtension<T>, Grid.Column<T>, Grid.DataCommunicatorBuilder<T,
U extends ArrayUpdater>, Grid.MultiSortPriority, Grid.NestedNullBehavior, Grid.SelectionMode, Grid.UpdateQueue Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
BlurNotifier.BlurEvent<C extends Component>
Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
FocusNotifier.FocusEvent<C extends Component>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRegisters a listener to be notified when the user starts to edit an existing item.addEditColumn
(ValueProvider<E, ?> valueProvider) Adds a new edit column to thisGridPro
with a value provider.addEditColumn
(ValueProvider<E, ?> valueProvider, Renderer<E> renderer) Adds a new edit column to thisGridPro
with a value provider and renderer which is used to display the content when the cell is not in the edit mode.<V extends Comparable<? super V>>
EditColumnConfigurator<E>addEditColumn
(ValueProvider<E, V> valueProvider, String... sortingProperties) Adds a new edit column to thisGridPro
with a value provider and sorting properties.addEditColumn
(String propertyName) Adds a new edit column for the given property name.addItemPropertyChangedListener
(ComponentEventListener<GridPro.ItemPropertyChangedEvent<E>> listener) Registers a listener to be notified when the user has edited an existing item.void
addThemeVariants
(GridProVariant... variants) Adds theme variants to the component.protected GridPro.EditColumn<E>
createEditColumn
(Renderer<E> renderer, String columnId) Creates a new edit column instance for thisGridPro
instance.boolean
Gets the value of the webcomponent's property editOnClick.boolean
Gets the value of the webcomponent's property enterNextRow.boolean
Gets the value of the webcomponent's property singleCellEdit.void
onEnabledStateChanged
(boolean enabled) Handle component enable state when the enabled state changes.void
removeThemeVariants
(GridProVariant... variants) Removes theme variants from the component.void
setEditOnClick
(boolean editOnClick) Sets the value of the webcomponent's property editOnClick.void
setEnterNextRow
(boolean enterNextRow) Sets the value of the webcomponent's property enterNextRow.void
setSingleCellEdit
(boolean singleCellEdit) Sets the value of the webcomponent's property singleCellEdit.Methods inherited from class com.vaadin.flow.component.grid.Grid
addCellFocusListener, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumnReorderListener, addColumnResizeListener, addColumns, addComponentColumn, addContextMenu, addDataGenerator, addDragEndListener, addDragStartListener, addDropListener, addFirstHeaderRow, addItemClickListener, addItemDoubleClickListener, addSelectionListener, addSortListener, addThemeVariants, addValueProvider, appendFooterRow, appendHeaderRow, asMultiSelect, asSingleSelect, compareMaybeComparables, configureBeanType, createColumn, createColumnId, createDefaultArrayUpdater, createEditor, createSortingComparator, deselect, deselectAll, getArrayUpdater, getBeanType, getClassNameGenerator, getColumnByKey, getColumnLayers, getColumnRendering, getColumns, getDataCommunicator, getDataProvider, getDefaultColumnFactory, getDefaultHeaderRow, getDragFilter, getDropFilter, getDropMode, getEditor, getFooterRows, getGenericDataView, getHeaderRows, getLazyDataView, getListDataView, getNestedNullBehavior, getPageSize, getPartNameGenerator, getPropertySet, getSelectedItems, getSelectionModel, getSortOrder, getUniqueKeyProperty, getUniqueKeyProvider, initConnector, insertColumnLayer, isAllRowsVisible, isColumnReorderingAllowed, isDetailsVisible, isDetailsVisibleOnClick, isMultiSort, isRowsDraggable, onAttach, onDataProviderChange, onDetach, prependFooterRow, prependHeaderRow, recalculateColumnWidths, removeAllColumns, removeColumn, removeColumnByKey, removeColumnLayer, removeColumns, removeThemeVariants, scrollToEnd, scrollToIndex, scrollToStart, select, setAllRowsVisible, setClassNameGenerator, setColumnKey, setColumnOrder, setColumnOrder, setColumnRendering, setColumnReorderingAllowed, setColumns, setDataProvider, setDefaultMultiSortPriority, setDetailsVisible, setDetailsVisibleOnClick, setDragDataGenerator, setDragFilter, setDropFilter, setDropMode, setItemDetailsRenderer, setItems, setItems, setItems, setItems, setMultiSort, setMultiSort, setMultiSort, setMultiSort, setNestedNullBehavior, setPageSize, setPartNameGenerator, setRowsDraggable, setSelectionDragDetails, setSelectionMode, setSelectionModel, setSortableColumns, setTooltipGenerator, setUniqueKeyProperty, setUniqueKeyProvider, sort, updateSelectionModeOnClient
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible
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.BlurNotifier
addBlurListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
Methods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListener
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
Methods inherited from interface com.vaadin.flow.data.provider.HasLazyDataView
setItems, setItems
Methods inherited from interface com.vaadin.flow.data.provider.HasListDataView
setItems, setItems
Methods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
Methods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
-
Constructor Details
-
GridPro
Instantiates a new CrudGrid for the supplied bean type.- Parameters:
beanType
- the beanType for the item
-
GridPro
public GridPro()Creates a new instance, with page size of 50. -
GridPro
public GridPro(int pageSize) Creates a new instance, with the specified page size.The page size influences the
Query.getLimit()
sent by the client, but it's up to the webcomponent to determine the actual query limit, based on the height of the component and scroll position. Usually the limit is 3 times the page size (e.g. 150 items with a page size of 50).- Parameters:
pageSize
- the page size. Must be greater than zero.
-
-
Method Details
-
onEnabledStateChanged
public void onEnabledStateChanged(boolean enabled) Description copied from class:Component
Handle component enable state when the enabled state changes.By default this sets or removes the 'disabled' attribute from the element. This can be overridden to have custom handling.
- Overrides:
onEnabledStateChanged
in classGrid<E>
- Parameters:
enabled
- the new enabled state of the component
-
addEditColumn
Adds a new edit column to thisGridPro
with a value provider.- Parameters:
valueProvider
- the value provider- Returns:
- an edit column configurer for configuring the column editor
- See Also:
-
addEditColumn
public EditColumnConfigurator<E> addEditColumn(ValueProvider<E, ?> valueProvider, Renderer<E> renderer) Adds a new edit column to thisGridPro
with a value provider and renderer which is used to display the content when the cell is not in the edit mode.- Parameters:
valueProvider
- the value providerrenderer
- the renderer- Returns:
- an edit column configurer for configuring the column editor
- See Also:
-
addEditColumn
public <V extends Comparable<? super V>> EditColumnConfigurator<E> addEditColumn(ValueProvider<E, V> valueProvider, String... sortingProperties) Adds a new edit column to thisGridPro
with a value provider and sorting properties.- Parameters:
valueProvider
- the value providersortingProperties
- the sorting properties to use for this column- Returns:
- an edit column configurer for configuring the column editor
- See Also:
-
addEditColumn
Adds a new edit column for the given property name.Note: This method can only be used for a Grid created from a bean type with
GridPro(Class)
.- Parameters:
propertyName
- the property name of the new column, notnull
- Returns:
- and edit column configurer for configuring the column editor
- See Also:
-
setEnterNextRow
public void setEnterNextRow(boolean enterNextRow) Sets the value of the webcomponent's property enterNextRow. Default values is false. When true, pressing Enter while in cell edit mode will move focus to the editable cell in the next row (Shift + Enter - same, but for previous row).- Parameters:
enterNextRow
- whentrue
, pressing Enter while in cell edit mode will move focus to the editable cell in the next row (Shift + Enter - same, but for previous row)
-
getEnterNextRow
Gets the value of the webcomponent's property enterNextRow. Default values is false. When true, pressing Enter while in cell edit mode will move focus to the editable cell in the next row (Shift + Enter - same, but for previous row).- Returns:
- enterNextRow value
-
setSingleCellEdit
public void setSingleCellEdit(boolean singleCellEdit) Sets the value of the webcomponent's property singleCellEdit. Default values is false. When true, after moving to next or previous editable cell using Tab / Shift+Tab, it will be focused without edit mode.- Parameters:
singleCellEdit
- whentrue
, after moving to next or previous editable cell using Tab / Shift+Tab, it will be focused without edit mode
-
getSingleCellEdit
Gets the value of the webcomponent's property singleCellEdit. Default values is false. When true, after moving to next or previous editable cell using Tab / Shift+Tab, it will be focused without edit mode.- Returns:
- singleCellEdit value
-
setEditOnClick
public void setEditOnClick(boolean editOnClick) Sets the value of the webcomponent's property editOnClick. Default values is false. When true, cell edit mode gets activated on a single click instead of the default double click.- Parameters:
editOnClick
- whentrue
, cell edit mode gets activated on a single click instead of the default double click
-
getEditOnClick
Gets the value of the webcomponent's property editOnClick. Default values is false. When true, cell edit mode gets activated on a single click instead of the default double click.- Returns:
- editOnClick value
-
createEditColumn
Creates a new edit column instance for thisGridPro
instance.This method must not return
null
.- Parameters:
renderer
- the renderer used to create the grid cell structurecolumnId
- internal column id- Returns:
- edit column instance
- See Also:
-
addCellEditStartedListener
public Registration addCellEditStartedListener(ComponentEventListener<GridPro.CellEditStartedEvent<E>> listener) Registers a listener to be notified when the user starts to edit an existing item.- Parameters:
listener
- a listener to be notified- Returns:
- a handle that can be used to unregister the listener
-
addItemPropertyChangedListener
public Registration addItemPropertyChangedListener(ComponentEventListener<GridPro.ItemPropertyChangedEvent<E>> listener) Registers a listener to be notified when the user has edited an existing item.- Parameters:
listener
- a listener to be notified- Returns:
- a handle that can be used to unregister the listener
-
addThemeVariants
Adds theme variants to the component.- Parameters:
variants
- theme variants to add
-
removeThemeVariants
Removes theme variants from the component.- Parameters:
variants
- theme variants to remove
-