DataTransfer
package js.html
Available on js
The DataTransfer
object is used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API.
Documentation DataTransfer by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
Constructor
new()
Throws:
null |
DOMError |
---|
Variables
dropEffect:String
Gets the type of drag-and-drop operation currently selected or sets the operation to a new type. The value must be none
, copy
, link
or move
.
effectAllowed:String
Provides all of the types of operations that are possible. Must be one of none
, copy
, copyLink
, copyMove
, link
, linkMove
, move
, all
or uninitialized
.
read onlyfiles:FileList
Contains a list of all the local files available on the data transfer. If the drag operation doesn't involve dragging files, this property is an empty list.
read onlyitems:DataTransferItemList
Gives a DataTransferItemList
object which is a list of all of the drag data.
read onlytypes:Array<String>
An array of DOMString
giving the formats that were set in the dragstart
event.
Methods
addElement(element:Element):Void
Sets the drag source to the given element.
Throws:
null |
DOMError |
---|
clearData(?format:String):Void
Remove the data associated with a given type. The type argument is optional. If the type is empty or not specified, the data associated with all types is removed. If data for the specified type does not exist, or the data transfer contains no data, this method will have no effect.
Throws:
null |
DOMError |
---|
getData(format:String):String
Retrieves the data for a given type, or an empty string if data for that type does not exist or the data transfer contains no data.
Throws:
null |
DOMError |
---|
setData(format:String, data:String):Void
Set the data for a given type. If data for the type does not exist, it is added at the end, such that the last item in the types list will be the new format. If data for the type already exists, the existing data is replaced in the same position.
Throws:
null |
DOMError |
---|
setDragImage(image:Element, x:Int, y:Int):Void
Set the image to be used for dragging if a custom one is desired.
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/DataTransfer.html