Protocol: SC.DragSource

The DragSource protocol is used to dynamically generate multiple types of data from a single object. You must implement this protocol if you want to provide the data for a drag event.

Defined in: drag_source.js.

Field Summary

Class Methods

Field Detail

Boolean SC.DragSource.ignoreModifierKeysWhileDragging

If this property is set to NO or is not implemented, then the user may modify the drag operation by changing the modifier keys they have pressed.

Default Value:
NO

Class Method Detail

dragDidBegin

This method is called when the drag begins. You can use this to do any visual highlighting to indicate that the receiver is the source of the drag.

Parameters:
SC.Drag drag
The Drag instance managing this drag.
Point loc
The point in *window* coordinates where the drag began. You can use convertOffsetFromView() to convert this to local coordinates.
dragDidEnd

This method is called when the drag ended. You can use this to do any cleanup. The operation is the actual operation performed on the drag.

Parameters:
SC.Drag drag
The drag instance managing the drag.
Point loc
The point in WINDOW coordinates where the drag ended.
DragOp op
The drag operation that was performed. One of SC.DRAG_COPY, SC.DRAG_MOVE, SC.DRAG_LINK, or SC.DRAG_NONE.
dragDidMove

This method is called whenever the drag image is moved. This is similar to the dragUpdated() method called on drop targets.

Parameters:
SC.Drag drag
The Drag instance managing this drag.
Point loc
The point in *window* coordinates where the drag mouse is. You can use convertOffsetFromView() to convert this to local coordinates.
dragSourceOperationMaskFor

This method must be overridden for drag operations to be allowed. Return a bitwise OR'd mask of the drag operations allowed on the specified target. If you don't care about the target, just return a constant value.

The default implementation returns SC.DRAG_NONE

Parameters:
SC.View dropTarget
The proposed target of the drop.
SC.Drag drag
The SC.Drag instance managing this drag.
Documentation generated by JsDoc Toolkit 2.4.0 on Thu Apr 11 2013 16:14:35 GMT+0800 (CST)