DRAGANDDROP.md 842 Bytes
Newer Older
1
2
3
4
5
6
# Drag And Drop

## Sort
Initialize a dnd container by adding the class "qfq-dnd"

Set container object class to `class="qfq-dnd qfq-dnd-sort"`.
7
8
9

Add the data elements: `data-dnd-api="url"` and `data-dnd-key="key"`.

10
11
12
13
14
15
16
17
18
19
For the children inside of the container (just the first children):
add `data-dnd-id` to a reference you can handle (probably record id).

Request will be sent containing following GET variables:

* dragId = `data-dnd-id` of the dragged object,
* dragPosition = client internal old position of the dragged object.
* setTo = "after" or "before",
* hoverId = `data-dnd-id` id of the element the dragged element is now hovering, meaning before or after.
* hoverPosition = client internal position of currently hovered element.
20
21
22


Example: http://something/bla?dragId=uno&dragPosition=1&setTo=before&hoverId=tre&hoverPosition=3