public class MultiSelectionModelConnector extends AbstractSelectionModelConnector
This selection model displays a selection column Grid.SelectionColumn as
the first column of the grid.
Implementation detail: The Grid selection is updated immediately on client side, without waiting for the server response.
| Modifier and Type | Class and Description |
|---|---|
protected class |
MultiSelectionModelConnector.MultiSelectionModel
Client side multiselection model implementation.
|
| Constructor and Description |
|---|
MultiSelectionModelConnector() |
| Modifier and Type | Method and Description |
|---|---|
protected MultiSelectionModelConnector.MultiSelectionModel |
createSelectionModel()
Creates an instance of MultiSelectionModel.
|
MultiSelectionModelState |
getState()
Returns the shared state object for this connector.
|
protected void |
initSelectionModel()
Initializes the selection model and sets it to the grid.
|
protected boolean |
isAllSelected()
Returns whether all items are selected or not.
|
protected boolean |
isSelected(elemental.json.JsonObject item)
Returns whether the given item selected in grid or not.
|
protected void |
onSelectAllEvent(SelectAllEvent<elemental.json.JsonObject> event)
Handler for selecting / deselecting all grid rows.
|
void |
onUnregister()
Event called when connector has been unregistered.
|
protected void |
updateAllRowsSelected(boolean selected)
Update selection for all grid rows.
|
protected void |
updateRowSelected(DataSource.RowHandle<elemental.json.JsonObject> row,
boolean selected)
Marks the given row to be selected or deselected.
|
protected void |
updateSelectAllCheckBox()
Called whenever there has been a state update for select all checkbox
visibility or all have been selected or deselected.
|
extend, getGrid, getParent, getSpaceSelectionHandlersetParentaddStateChangeHandler, addStateChangeHandler, createState, doInit, ensureHandlerManager, fireEvent, forceStateChange, getChildren, getConnection, getConnectorId, getResourceUrl, getRpcImplementations, getRpcProxy, getStateType, getTag, hasEventListener, init, isEnabled, onStateChanged, registerRpc, removeStateChangeHandler, removeStateChangeHandler, setChildren, setTag, unregisterRpc, updateEnabledStateprotected void initSelectionModel()
AbstractSelectionModelConnector
This method is only invoked once by AbstractSelectionModelConnector.extend(ServerConnector) in
AbstractSelectionModelConnector when the grid is available via
AbstractSelectionModelConnector.getGrid() and the selection model should be taken into use.
initSelectionModel in class AbstractSelectionModelConnectorprotected MultiSelectionModelConnector.MultiSelectionModel createSelectionModel()
nullpublic void onUnregister()
ServerConnectoronUnregister in interface ServerConnectoronUnregister in class AbstractSelectionModelConnectorpublic MultiSelectionModelState getState()
AbstractConnectorgetState in interface ServerConnectorgetState in class AbstractSelectionModelConnectorprotected void updateSelectAllCheckBox()
protected boolean isAllSelected()
true if all items are selected, false if notprotected void onSelectAllEvent(SelectAllEvent<elemental.json.JsonObject> event)
event - the select all event from gridprotected void updateAllRowsSelected(boolean selected)
selected - true for marking all rows selected, false for
not selectedprotected boolean isSelected(elemental.json.JsonObject item)
AbstractSelectionModelConnectorisSelected in class AbstractSelectionModelConnectoritem - the item to checktrue if selected false if notprotected void updateRowSelected(DataSource.RowHandle<elemental.json.JsonObject> row, boolean selected)
Note: If selection model is in batch select state, the row will be pinned on select.
row - row handleselected - true if row should be selected; false if notCopyright © 2021 Vaadin Ltd. All rights reserved.