M
- the model typepublic class CellSelectionModel<M> extends GridSelectionModel<M> implements CellSelectionChangedEvent.HasCellSelectionChangedHandlers<M>
Cell based selection model. User selectCell(int, int)
to select a cell and deselectAll()
to
deselect.
CellSelectionModel extends GridSelectionModel. However, CellSelectionModel
only supports cell selections, no row based selections or events are
supported. Use addCellSelectionChangedHandler(com.sencha.gxt.widget.core.client.selection.CellSelectionChangedEvent.CellSelectionChangedHandler)
to be notified of selection changes.
GridSelectionModel.SelectionModelCallback
Modifier and Type | Field and Description |
---|---|
protected CellSelection<M> |
selection |
deselectOnSimpleClick, enableNavKeys, grid, handlerRegistration, keyNav, listStore
fireSelectionChangeOnClick, lastSelected, locked, mouseDown, selected, selectionMode, store
Constructor and Description |
---|
CellSelectionModel() |
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addCellSelectionChangedHandler(CellSelectionChangedEvent.CellSelectionChangedHandler<M> handler)
Adds a
CellSelectionChangedEvent.CellSelectionChangedHandler handler for
CellSelectionChangedEvent events. |
HandlerRegistration |
addSelectionChangedHandler(SelectionChangedEvent.SelectionChangedHandler<M> handler)
Adds a
SelectionChangedEvent.SelectionChangedHandler handler for
SelectionChangedEvent events. |
HandlerRegistration |
addSelectionHandler(<any> handler)
Adds a
SelectionChangedEvent.SelectionChangedHandler handler for SelectionChangedEvent events. |
void |
bindGrid(Grid<M> grid)
Binds the given grid to this selection model.
|
void |
deselect(int index)
Deselects the item at the given index.
|
void |
deselect(int start,
int end)
Deselects the range.
|
void |
deselect(List<M> items)
Deselects the items.
|
void |
deselect(M... items)
Deselects the items.
|
void |
deselect(M item)
Deselects the item.
|
void |
deselectAll()
Deselects all selections.
|
CellSelection<M> |
getSelectCell()
Returns the selected cell or null.
|
M |
getSelectedItem()
Returns the selected item.
|
List<M> |
getSelectedItems()
Returns the selected items.
|
protected void |
handleMouseDown(CellMouseDownEvent event) |
protected void |
onKeyDown(NativeEvent e)
Handles a key down event (e.g.
|
protected void |
onKeyPress(NativeEvent e)
Handles a key press event (e.g.
|
protected void |
onKeyUp(NativeEvent e)
Handles a key up event (e.g.
|
protected void |
onUpdate(M model) |
void |
select(boolean keepExisting,
M... items)
Selects the items.
|
void |
select(int index,
boolean keepExisting)
Selects the item at the given index.
|
void |
select(int start,
int end,
boolean keepExisting)
Selects the range.
|
void |
select(List<M> items,
boolean keepExisting)
Selects the items.
|
void |
select(M item,
boolean keepExisting)
Selects the item.
|
void |
selectAll()
Selects all items.
|
void |
selectCell(int row,
int cell)
Selects the cell.
|
bind, getGrid, hasNext, hasPrevious, isSelectable, onKeyLeft, onKeyRight, onLastFocusChanged, onRecordChange, onRowClick, onRowMouseDown, onSelectChange, selectNext, selectPrevious
addBeforeSelectionHandler, doDeselect, doMultiSelect, doSelect, doSingleSelect, ensureHandlers, fireEvent, fireSelectionChange, getLastFocused, getSelection, getSelectionMode, isLocked, isSelected, onAdd, onClear, onRemove, refresh, setLastFocused, setLocked, setSelection, setSelectionMode
protected CellSelection<M> selection
public HandlerRegistration addCellSelectionChangedHandler(CellSelectionChangedEvent.CellSelectionChangedHandler<M> handler)
CellSelectionChangedEvent.HasCellSelectionChangedHandlers
CellSelectionChangedEvent.CellSelectionChangedHandler
handler for
CellSelectionChangedEvent
events.addCellSelectionChangedHandler
in interface CellSelectionChangedEvent.HasCellSelectionChangedHandlers<M>
handler
- the handlerpublic HandlerRegistration addSelectionChangedHandler(SelectionChangedEvent.SelectionChangedHandler<M> handler)
SelectionChangedEvent.HasSelectionChangedHandlers
SelectionChangedEvent.SelectionChangedHandler
handler for
SelectionChangedEvent
events.addSelectionChangedHandler
in interface SelectionChangedEvent.HasSelectionChangedHandlers<M>
addSelectionChangedHandler
in class AbstractStoreSelectionModel<M>
handler
- the handlerpublic HandlerRegistration addSelectionHandler(<any> handler)
AbstractStoreSelectionModel
SelectionChangedEvent.SelectionChangedHandler
handler for SelectionChangedEvent
events.addSelectionHandler
in class AbstractStoreSelectionModel<M>
handler
- the handlerpublic void bindGrid(Grid<M> grid)
GridSelectionModel
bindGrid
in class GridSelectionModel<M>
grid
- the grid to bind to this selection modelpublic void deselect(int index)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M>
deselect
in class AbstractStoreSelectionModel<M>
index
- the index of the item to be deselectedpublic void deselect(int start, int end)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M>
deselect
in class AbstractStoreSelectionModel<M>
start
- the start indexend
- the end indexpublic void deselect(List<M> items)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M>
deselect
in class AbstractStoreSelectionModel<M>
items
- the itempublic void deselect(M item)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M>
deselect
in class AbstractStoreSelectionModel<M>
item
- the item to be deselectedpublic void deselect(M... items)
StoreSelectionModel
deselect
in interface StoreSelectionModel<M>
deselect
in class AbstractStoreSelectionModel<M>
items
- the items to deselectpublic void deselectAll()
StoreSelectionModel
deselectAll
in interface StoreSelectionModel<M>
deselectAll
in class AbstractStoreSelectionModel<M>
public CellSelection<M> getSelectCell()
public M getSelectedItem()
StoreSelectionModel
getSelectedItem
in interface StoreSelectionModel<M>
getSelectedItem
in class AbstractStoreSelectionModel<M>
public List<M> getSelectedItems()
StoreSelectionModel
getSelectedItems
in interface StoreSelectionModel<M>
getSelectedItems
in class AbstractStoreSelectionModel<M>
public void select(boolean keepExisting, M... items)
StoreSelectionModel
select
in interface StoreSelectionModel<M>
select
in class AbstractStoreSelectionModel<M>
keepExisting
- true to keep existing selecteditems
- the itemspublic void select(int index, boolean keepExisting)
StoreSelectionModel
select
in interface StoreSelectionModel<M>
select
in class AbstractStoreSelectionModel<M>
index
- the index of the item to be selectedkeepExisting
- true to keep existing selectedpublic void select(int start, int end, boolean keepExisting)
StoreSelectionModel
select
in interface StoreSelectionModel<M>
select
in class AbstractStoreSelectionModel<M>
start
- the start indexend
- the end indexkeepExisting
- true to keep existing selectedpublic void select(List<M> items, boolean keepExisting)
StoreSelectionModel
select
in interface StoreSelectionModel<M>
select
in class AbstractStoreSelectionModel<M>
items
- the items to selectkeepExisting
- true to keep existing selectedpublic void select(M item, boolean keepExisting)
StoreSelectionModel
select
in interface StoreSelectionModel<M>
select
in class AbstractStoreSelectionModel<M>
item
- the itemkeepExisting
- true to keep existing selectedpublic void selectAll()
StoreSelectionModel
selectAll
in interface StoreSelectionModel<M>
selectAll
in class AbstractStoreSelectionModel<M>
public void selectCell(int row, int cell)
row
- the row indexcell
- the cell indexprotected void handleMouseDown(CellMouseDownEvent event)
protected void onKeyDown(NativeEvent e)
GridSelectionModel
onKeyDown
in class GridSelectionModel<M>
e
- the key down eventprotected void onKeyPress(NativeEvent e)
GridSelectionModel
onKeyPress
in class GridSelectionModel<M>
e
- the key press eventprotected void onKeyUp(NativeEvent e)
GridSelectionModel
onKeyUp
in class GridSelectionModel<M>
e
- the key up eventprotected void onUpdate(M model)
onUpdate
in class GridSelectionModel<M>
Copyright © 2018. All rights reserved.