onStart: function (/**Event*/evt) { /* dragging */ },
onStart: function (/**Event*/evt) { /* dragging */ },
onEnd: function (/**Event*/evt) { /* dragging */ },
onEnd: function (/**Event*/evt) { /* dragging */ },
// Element is dropped into the list from another list
onAdd: function (/**Event*/evt){
onAdd: function (/**Event*/evt){
var itemEl = evt.item; // dragged HTMLElement
var itemEl = evt.item; // dragged HTMLElement
},
},
// Changed sorting within list
onUpdate: function (/**Event*/evt){
onUpdate: function (/**Event*/evt){
var itemEl = evt.item; // dragged HTMLElement
var itemEl = evt.item; // dragged HTMLElement
},
},
// Element is removed from the list into another list
onRemove: function (/**Event*/evt){
onRemove: function (/**Event*/evt){
var itemEl = evt.item; // dragged HTMLElement
var itemEl = evt.item; // dragged HTMLElement
},
},
@ -63,6 +66,12 @@ new Sortable(el, {
});
});
```
```
### group
To drag elements from one list into another, both lists must have the same `group` value.
In the [upcoming dev version](https://github.com/RubaXa/Sortable/tree/dev), you can also define whether lists can give away, give and keep a copy (clone), and receive elements.
#### handle
#### handle
To make list items draggable, Sortable disables text selection by the user. That's not always desirable. To allow text selection, define a drag handler, which is an area of every list element that allows it to be dragged around.
To make list items draggable, Sortable disables text selection by the user. That's not always desirable. To allow text selection, define a drag handler, which is an area of every list element that allows it to be dragged around.