 Loading...
Class DataTransfer
DataTransfer objects can conceptually contain various kinds of data.
Members Table
The following table lists the members exposed by the DataTransfer object.
|
Show:
|
Property |
Type |
Readonly |
Description |
dropEffect |
String |
false
|
Controls the drag-and-drop feedback that the user is given during a drag-and-drop operation.
|
effectAllowed |
String |
false
|
Used in the drag-and-drop processing model to initialise the dropEffect attribute during the dragenter and dragover events.
|
types |
StringList |
true |
Contains the list of formats that are stored in the DataTransfer object.
|
Method |
Returns |
Description |
addElement |
Void |
An alternative way of specifying how the user agent is to render the drag feedback.
It adds an element to the DataTransfer object.
|
Sytaxis:
object.addElement(node) Arguments:
Name |
Type |
O/R |
Description |
node |
Element |
Required |
Reference to an element.
|
|
clearData |
Void |
Clears the DataTransfer object of any data associated with the given format.
|
Sytaxis:
object.clearData(format) Arguments:
Name |
Type |
O/R |
Description |
format |
String |
Required |
Data format.
|
|
getData |
String |
Returns the data that is associated with the type format, if any.
|
Sytaxis:
object.getData(format) Arguments:
Name |
Type |
O/R |
Description |
format |
String |
Required |
Data format.
|
|
setData |
Void |
Adds data to the data stored in the DataTransfer object, labeled as being of the type format.
|
Sytaxis:
object.setData(format, data) Arguments:
Name |
Type |
O/R |
Description |
format |
String |
Required |
Data format.
|
data |
String |
Required |
Data content.
|
|
setDragImage |
Void |
Sets which element to use to generate the drag feedback.
|
Sytaxis:
object.setDragImage(image, x, y) Arguments:
Name |
Type |
O/R |
Description |
image |
Element |
Required |
Reference to an image element.
|
x |
Number |
Required |
Left coordinate.
|
y |
Number |
Required |
Top coordinate.
|
|
Event |
B |
C |
Interface |
Description |
Constant |
Value |
Description |
|
Examples
<div ondrop="event.dataTransfer.getData('text/plain')">
<div aml:draggable="true"></div>
<div aml:draggable="true"></div>
</div>
|