@Tag(value="vaadin-grid-pro") @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="22.0.21") @NpmPackage(value="@vaadin/grid-pro",version="22.0.21") @NpmPackage(value="@vaadin/vaadin-grid-pro",version="22.0.21") @JsModule(value="@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule(value="@vaadin/grid-pro/src/vaadin-grid-pro.js") @JsModule(value="@vaadin/grid-pro/src/vaadin-grid-pro-edit-column.js") @JsModule(value="./gridProConnector.js") public class GridPro<E> extends Grid<E>
Modifier and Type | Class and Description |
---|---|
static class |
GridPro.CellEditStartedEvent<E>
Event fired when the user starts to edit an existing item.
|
static class |
GridPro.EditColumn<T>
Server-side component for the
<vaadin-grid-edit-column> element. |
static class |
GridPro.ItemPropertyChangedEvent<E>
Event fired when the user has edited an existing item.
|
Grid.AbstractGridExtension<T>, Grid.Column<T>, Grid.DataCommunicatorBuilder<T,U extends ArrayUpdater>, Grid.NestedNullBehavior, Grid.SelectionMode, Grid.UpdateQueue
BlurNotifier.BlurEvent<C extends Component>
FocusNotifier.FocusEvent<C extends Component>
Constructor and Description |
---|
GridPro()
Creates a new instance, with page size of 50.
|
GridPro(Class<E> beanType)
Instantiates a new CrudGrid for the supplied bean type.
|
GridPro(int pageSize)
Creates a new instance, with the specified page size.
|
Modifier and Type | Method and Description |
---|---|
Registration |
addCellEditStartedListener(ComponentEventListener<GridPro.CellEditStartedEvent<E>> listener)
Registers a listener to be notified when the user starts to edit an
existing item.
|
EditColumnConfigurator<E> |
addEditColumn(String propertyName)
Adds a new edit column for the given property name.
|
EditColumnConfigurator<E> |
addEditColumn(ValueProvider<E,?> valueProvider)
Adds a new edit column to this
GridPro with a value provider. |
EditColumnConfigurator<E> |
addEditColumn(ValueProvider<E,?> valueProvider,
Renderer<E> renderer)
Adds a new edit column to this
GridPro 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>> |
addEditColumn(ValueProvider<E,V> valueProvider,
String... sortingProperties)
Adds a new edit column to this
GridPro with a value provider and
sorting properties. |
Registration |
addItemPropertyChangedListener(ComponentEventListener<GridPro.ItemPropertyChangedEvent<E>> listener)
Registers a listener to be notified when the user has edited an existing
item.
|
protected GridPro.EditColumn<E> |
createEditColumn(Renderer<E> renderer,
String columnId)
Creates a new edit column instance for this
GridPro instance. |
boolean |
getEditOnClick()
Gets the value of the webcomponent's property editOnClick.
|
boolean |
getEnterNextRow()
Gets the value of the webcomponent's property enterNextRow.
|
boolean |
getSingleCellEdit()
Gets the value of the webcomponent's property singleCellEdit.
|
void |
onEnabledStateChanged(boolean enabled)
Handle component enable state when the enabled state changes.
|
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.
|
addCellFocusListener, addColumn, addColumn, 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, getColumns, getDataCommunicator, getDataProvider, getDefaultColumnFactory, getDefaultHeaderRow, getDragFilter, getDropFilter, getDropMode, getEditor, getFooterRows, getGenericDataView, getHeaderRows, getLazyDataView, getListDataView, getNestedNullBehavior, getPageSize, getPropertySet, getSelectedItems, getSelectionModel, getSortOrder, getUniqueKeyProperty, getUniqueKeyProvider, initConnector, insertColumnLayer, isAllRowsVisible, isColumnReorderingAllowed, isDetailsVisible, isDetailsVisibleOnClick, isHeightByRows, isMultiSort, isRowsDraggable, isVerticalScrollingEnabled, onAttach, onDataProviderChange, onDetach, prependFooterRow, prependHeaderRow, recalculateColumnWidths, removeAllColumns, removeColumn, removeColumnByKey, removeColumnLayer, removeColumns, removeThemeVariants, scrollToEnd, scrollToIndex, scrollToStart, select, setAllRowsVisible, setClassNameGenerator, setColumnKey, setColumnOrder, setColumnOrder, setColumnReorderingAllowed, setColumns, setDataProvider, setDetailsVisible, setDetailsVisibleOnClick, setDragDataGenerator, setDragFilter, setDropFilter, setDropMode, setHeightByRows, setItemDetailsRenderer, setItems, setItems, setItems, setItems, setItems, setMultiSort, setNestedNullBehavior, setPageSize, setRowsDraggable, setSelectionDragDetails, setSelectionMode, setSelectionModel, setSortableColumns, setUniqueKeyProperty, setUniqueKeyProvider, setVerticalScrollingEnabled, sort, updateSelectionModeOnClient
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
getCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
addBlurListener
addFocusListener
isEnabled, setEnabled
getElement
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
setItems, setItems
setItems, setItems
addAttachListener
addDetachListener
public GridPro(Class<E> beanType)
beanType
- the beanType for the itempublic GridPro()
public GridPro(int pageSize)
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).
pageSize
- the page size. Must be greater than zero.public void onEnabledStateChanged(boolean enabled)
Component
By default this sets or removes the 'disabled' attribute from the element. This can be overridden to have custom handling.
onEnabledStateChanged
in class Grid<E>
enabled
- the new enabled state of the componentpublic EditColumnConfigurator<E> addEditColumn(ValueProvider<E,?> valueProvider)
GridPro
with a value provider.valueProvider
- the value providerGrid.addColumn(ValueProvider)
,
EditColumnConfigurator.text(ItemUpdater)
,
EditColumnConfigurator.checkbox(ItemUpdater)
,
EditColumnConfigurator.select(ItemUpdater, List)
,
Grid.removeColumn(Column)
public EditColumnConfigurator<E> addEditColumn(ValueProvider<E,?> valueProvider, Renderer<E> renderer)
GridPro
with a value provider and
renderer which is used to display the content when the cell is not in the
edit mode.valueProvider
- the value providerrenderer
- the rendererGrid.addColumn(Renderer)
,
EditColumnConfigurator.text(ItemUpdater)
,
EditColumnConfigurator.checkbox(ItemUpdater)
,
EditColumnConfigurator.select(ItemUpdater, List)
,
Grid.removeColumn(Column)
public <V extends Comparable<? super V>> EditColumnConfigurator<E> addEditColumn(ValueProvider<E,V> valueProvider, String... sortingProperties)
GridPro
with a value provider and
sorting properties.valueProvider
- the value providersortingProperties
- the sorting properties to use for this columnGrid.addColumn(ValueProvider, String[])
,
Column#setComparator(ValueProvider)
,
Column#setSortProperty(String...)
,
EditColumnConfigurator.text(ItemUpdater)
,
EditColumnConfigurator.checkbox(ItemUpdater)
,
EditColumnConfigurator.select(ItemUpdater, List)
,
Grid.removeColumn(Column)
public EditColumnConfigurator<E> addEditColumn(String propertyName)
Note: This method can only be used for a Grid created
from a bean type with GridPro(Class)
.
propertyName
- the property name of the new column, not null
Grid.addColumn(String)
,
EditColumnConfigurator.text(ItemUpdater)
,
EditColumnConfigurator.checkbox(ItemUpdater)
,
EditColumnConfigurator.select(ItemUpdater, List)
,
Grid.removeColumn(Column)
public void setEnterNextRow(boolean enterNextRow)
enterNextRow
- 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)@Synchronize(value="enter-next-row-changed") public boolean getEnterNextRow()
public void setSingleCellEdit(boolean singleCellEdit)
singleCellEdit
- when true
, after moving to next or previous
editable cell using Tab / Shift+Tab, it will be focused
without edit mode@Synchronize(value="single-cell-edit-changed") public boolean getSingleCellEdit()
public void setEditOnClick(boolean editOnClick)
editOnClick
- when true
, cell edit mode gets activated on a
single click instead of the default double click@Synchronize(value="edit-on-click-changed") public boolean getEditOnClick()
protected GridPro.EditColumn<E> createEditColumn(Renderer<E> renderer, String columnId)
GridPro
instance.
This method must not return null
.
renderer
- the renderer used to create the grid cell structurecolumnId
- internal column idRenderer
public Registration addCellEditStartedListener(ComponentEventListener<GridPro.CellEditStartedEvent<E>> listener)
listener
- a listener to be notifiedpublic Registration addItemPropertyChangedListener(ComponentEventListener<GridPro.ItemPropertyChangedEvent<E>> listener)
listener
- a listener to be notifiedCopyright © 2022. All rights reserved.