M
- the model typepublic class GridDropTarget<M> extends DropTarget
Enables a Grid
to act as the target of a drag and drop operation.
Use DropTarget.setFeedback(com.sencha.gxt.dnd.core.client.DND.Feedback)
to specify whether to allow inserting
items between rows, appending items to the end, or both (defaults to
DND.Feedback.BOTH
).
Use DropTarget.setOperation(com.sencha.gxt.dnd.core.client.DND.Operation)
to specify whether to move items or copy
them (defaults to DND.Operation.MOVE
).
Modifier and Type | Field and Description |
---|---|
protected M |
activeItem |
protected Grid<M> |
grid |
protected int |
insertIndex |
dropWidget, feedback, operation, overStyle
Constructor and Description |
---|
GridDropTarget(Grid<M> grid)
Creates a drop target for the specified grid.
|
Modifier and Type | Method and Description |
---|---|
Grid<M> |
getGrid()
Returns the grid associated with this drop target.
|
protected void |
onDragDrop(DndDropEvent e)
Called when the user releases the mouse over the target widget.
|
protected void |
onDragEnter(DndDragEnterEvent e)
Called when the cursor first enters the bounds of the drop target.
|
protected void |
onDragMove(DndDragMoveEvent event)
Called when the cursor is moved within the target widget.
|
protected void |
showFeedback(DndDragMoveEvent event)
Called as the mouse is moved over the target widget.
|
addDragCancelHandler, addDragEnterHandler, addDragLeaveHandler, addDragMoveHandler, addDropHandler, disable, enable, getElementFromEvent, getFeedback, getGroup, getOperation, getOverStyle, getWidget, isAllowSelfAsSource, isEnabled, onDragCancelled, onDragFail, onDragLeave, onDropWidgetAttach, onDropWidgetDetach, prepareDropData, release, setAllowSelfAsSource, setFeedback, setGroup, setOperation, setOverStyle
protected M activeItem
protected int insertIndex
public Grid<M> getGrid()
protected void onDragDrop(DndDropEvent e)
DropTarget
onDragDrop
in class DropTarget
e
- the drop eventprotected void onDragEnter(DndDragEnterEvent e)
DropTarget
onDragEnter
in class DropTarget
e
- the drag enter eventprotected void onDragMove(DndDragMoveEvent event)
DropTarget
CancellableEvent.setCancelled(boolean)
to true,
DropTarget.showFeedback(DndDragMoveEvent)
will be called.onDragMove
in class DropTarget
event
- the dd eventprotected void showFeedback(DndDragMoveEvent event)
DropTarget
showFeedback
in class DropTarget
event
- the dd eventCopyright © 2018. All rights reserved.