DataTransfer (engine/view)
@ckeditor/ckeditor5-engine/src/view/datatransfer
A facade over the native DataTransfer object.
Filtering
Properties
-
dropEffect : 'link' | 'none' | 'copy' | 'move'module:engine/view/datatransfer~DataTransfer#dropEffect -
effectAllowed : 'link' | 'none' | 'copy' | 'move' | 'copyLink' | 'copyMove' | 'linkMove' | 'all' | 'uninitialized'module:engine/view/datatransfer~DataTransfer#effectAllowedParameters
value : 'link' | 'none' | 'copy' | 'move' | 'copyLink' | 'copyMove' | 'linkMove' | 'all' | 'uninitialized'
-
The array of files created from the native
DataTransfer#filesorDataTransfer#items. -
Whether the dragging operation was canceled.
-
Returns an array of available native content types.
-
The array of files created from the native
DataTransfer#filesorDataTransfer#items. -
The native DataTransfer object.
Methods
-
constructor( nativeDataTransfer, options = { [options.cacheFiles] } )module:engine/view/datatransfer~DataTransfer#constructorParameters
nativeDataTransfer : DataTransferThe native
DataTransferobject.options : object-
Properties
[ options.cacheFiles ] : booleanWhether
fileslist should be initialized in the constructor.
Defaults to
{}
-
getData( type ) → stringmodule:engine/view/datatransfer~DataTransfer#getDataGets the data from the data transfer by its MIME type.
dataTransfer.getData( 'text/plain' );Parameters
type : stringThe MIME type. E.g.
text/htmlortext/plain.
Returns
string
-
setData( type, data ) → voidmodule:engine/view/datatransfer~DataTransfer#setDataSets the data in the data transfer.
Parameters
type : stringThe MIME type. E.g.
text/htmlortext/plain.data : string
Returns
void
-
setDragImage( image, x, y ) → voidmodule:engine/view/datatransfer~DataTransfer#setDragImageSet a preview image of the dragged content.
Parameters
image : Elementx : numbery : number
Returns
void
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.
With the release of version 42.0.0, we have rewritten much of our documentation to reflect the new import paths and features. We appreciate your feedback to help us ensure its accuracy and completeness.