# DRAGNDROP

## Overview

The `DRAGNDROP` class provides constants for handling drag-and-drop operations in Servoy. Key operations include `COPY`, `MOVE`, and `NONE`, which allow developers to define behavior for copying, moving, or disabling drag functionality. These constants help streamline interaction handling in custom applications. Additionally, the class defines MIME types such as `MIME_TYPE_SERVOY` and `MIME_TYPE_SERVOY_RECORD`. These constants ensure proper identification of Servoy objects and records during drag-and-drop operations, enhancing integration and compatibility within the Servoy runtime environment.

## Constants Summarized

| Type                                                     | Name                                                   | Summary                                               |
| -------------------------------------------------------- | ------------------------------------------------------ | ----------------------------------------------------- |
| [Number](/reference/servoycore/dev-api/js-lib/number.md) | [COPY](#copy)                                          | Constant for copy drag operation.                     |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [MIME\_TYPE\_SERVOY](#mime_type_servoy)                | Constant used as mime type for servoy objects.        |
| [String](/reference/servoycore/dev-api/js-lib/string.md) | [MIME\_TYPE\_SERVOY\_RECORD](#mime_type_servoy_record) | Constant used as mime type for servoy record objects. |
| [Number](/reference/servoycore/dev-api/js-lib/number.md) | [MOVE](#move)                                          | Constant for move drag operation.                     |
| [Number](/reference/servoycore/dev-api/js-lib/number.md) | [NONE](#none)                                          | Constant for no drag operation.                       |

## Constants Detailed

### COPY

Constant for copy drag operation.

**Type**\
[Number](/reference/servoycore/dev-api/js-lib/number.md)

**Sample**

```js
function startDrag(event)
{
	if(event.getElementName() == "copy")
		return DRAGNDROP.COPY;
	else if(event.getElementName() == "move")
		return DRAGNDROP.MOVE

	return DRAGNDROP.NONE;
}
```

### MIME\_TYPE\_SERVOY

Constant used as mime type for servoy objects.

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md)

**Sample**

```js
if (event.dataMimeType == DRAGNDROP.MIME_TYPE_SERVOY || event.dataMimeType == DRAGNDROP.MIME_TYPE_SERVOY_RECORD) {
	application.output("Dropping is allowed" );
	return true;
} else {
	application.output("Dropping is not allowed" );
	return false;
}
```

### MIME\_TYPE\_SERVOY\_RECORD

Constant used as mime type for servoy record objects.

**Type**\
[String](/reference/servoycore/dev-api/js-lib/string.md)

**Sample**

```js
if (event.dataMimeType == DRAGNDROP.MIME_TYPE_SERVOY || event.dataMimeType == DRAGNDROP.MIME_TYPE_SERVOY_RECORD) {
	application.output("Dropping is allowed" );
	return true;
} else {
	application.output("Dropping is not allowed" );
	return false;
}
```

### MOVE

Constant for move drag operation.

**Type**\
[Number](/reference/servoycore/dev-api/js-lib/number.md)

**Sample**

```js
function startDrag(event)
{
	if(event.getElementName() == "copy")
		return DRAGNDROP.COPY;
	else if(event.getElementName() == "move")
		return DRAGNDROP.MOVE

	return DRAGNDROP.NONE;
}
```

### NONE

Constant for no drag operation.

**Type**\
[Number](/reference/servoycore/dev-api/js-lib/number.md)

**Sample**

```js
function startDrag(event)
{
	if(event.getElementName() == "copy")
		return DRAGNDROP.COPY;
	else if(event.getElementName() == "move")
		return DRAGNDROP.MOVE

	return DRAGNDROP.NONE;
}
```

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.servoy.com/reference/servoycore/dev-api/application/dragndrop.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
