@Tag(value="vaadin-grid-pro") @HtmlImport(value="frontend://bower_components/vaadin-grid-pro/src/vaadin-grid-pro.html") @HtmlImport(value="frontend://bower_components/vaadin-grid-pro/src/vaadin-grid-pro-edit-column.html") public class GridPro<E> extends Grid<E>
Modifier and Type | Class and Description |
---|---|
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 starts to edit an existing item.
|
Grid.AbstractGridExtension<T>, Grid.Column<T>, Grid.DataCommunicatorBuilder<T,U extends ArrayUpdater>, 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 |
---|---|
EditColumnConfigurator<E> |
addEditColumn(Renderer<E> renderer)
Adds a new edit column to this
GridPro with a renderer. |
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. |
Registration |
addItemPropertyChangedListener(ComponentEventListener<GridPro.ItemPropertyChangedEvent<E>> listener)
Registers a listener to be notified when the user starts to edit an existing item.
|
protected GridPro.EditColumn<E> |
createEditColumn(Renderer<E> renderer,
String columnId)
Creates a new edit column instance for this
GridPro instance. |
boolean |
getEnterNextRow()
Gets the value of the webcomponent's property enterNextRow.
|
boolean |
getKeepEditorOpen()
Gets the value of the webcomponent's property keepEditorOpen.
|
void |
setEnterNextRow(boolean enterNextRow)
Sets the value of the webcomponent's property enterNextRow.
|
void |
setKeepEditorOpen(boolean keepEditorOpen)
Sets the value of the webcomponent's property keepEditorOpen.
|
addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumns, addComponentColumn, addContextMenu, addDataGenerator, addFirstHeaderRow, addItemClickListener, addItemDoubleClickListener, addSelectionListener, addSortListener, addThemeVariants, addValueProvider, appendFooterRow, appendHeaderRow, asMultiSelect, asSingleSelect, compareMaybeComparables, createColumn, createColumnId, createDefaultArrayUpdater, createEditor, createSortingComparator, deselect, deselectAll, getArrayUpdater, getClassNameGenerator, getColumnByKey, getColumnLayers, getColumns, getDataCommunicator, getDataProvider, getDefaultColumnFactory, getDefaultHeaderRow, getEditor, getFooterRows, getHeaderRows, getPageSize, getPropertySet, getSelectedItems, getSelectionModel, getSortOrder, getUniqueKeyProperty, getUniqueKeyProvider, initConnector, insertColumnLayer, isColumnReorderingAllowed, isDetailsVisible, isDetailsVisibleOnClick, isHeightByRows, isMultiSort, isVerticalScrollingEnabled, onDataProviderChange, onEnabledStateChanged, prependFooterRow, prependHeaderRow, removeAllColumns, removeColumn, removeColumnByKey, removeColumnLayer, removeDataGenerator, removeThemeVariants, select, setClassNameGenerator, setColumnKey, setColumnReorderingAllowed, setColumns, setDataProvider, setDetailsVisible, setDetailsVisibleOnClick, setHeightByRows, setItemDetailsRenderer, setMultiSort, setPageSize, setSelectionMode, setSelectionModel, setSortableColumns, setUniqueKeyProperty, setUniqueKeyProvider, setVerticalScrollingEnabled, sort, updateSelectionModeOnClient
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setItems
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, setHeight, setHeightFull, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFull
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
addBlurListener
addFocusListener
isEnabled, setEnabled
getElement
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
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 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(Renderer<E> renderer)
GridPro
with a renderer.renderer
- the renderer used to create the grid cell structureGrid.addColumn(Renderer)
,
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 setKeepEditorOpen(boolean keepEditorOpen)
keepEditorOpen
- when true
, after moving to next or previous editable cell
using Tab / Shift+Tab, it will be focused in edit mode@Synchronize(value="keep-editor-open-changed") public boolean getKeepEditorOpen()
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 addItemPropertyChangedListener(ComponentEventListener<GridPro.ItemPropertyChangedEvent<E>> listener)
listener
- a listener to be notifiedCopyright © 2019. All rights reserved.