Skip to content

Commit a70d2c9

Browse files
committed
Document how to use group right now
1 parent c196b32 commit a70d2c9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,17 @@ new Sortable(el, {
4545
onStart: function (/**Event*/evt) { /* dragging */ },
4646
onEnd: function (/**Event*/evt) { /* dragging */ },
4747

48+
// Element is dropped into the list from another list
4849
onAdd: function (/**Event*/evt){
4950
var itemEl = evt.item; // dragged HTMLElement
5051
},
5152

53+
// Changed sorting within list
5254
onUpdate: function (/**Event*/evt){
5355
var itemEl = evt.item; // dragged HTMLElement
5456
},
5557

58+
// Element is removed from the list into another list
5659
onRemove: function (/**Event*/evt){
5760
var itemEl = evt.item; // dragged HTMLElement
5861
},
@@ -63,6 +66,12 @@ new Sortable(el, {
6366
});
6467
```
6568

69+
### group
70+
71+
To drag elements from one list into another, both lists must have the same `group` value.
72+
73+
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.
74+
6675
#### handle
6776

6877
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.

0 commit comments

Comments
 (0)