xxxxxxxxxx
1
<div data-mdb-sortable-init class="sortable-list" id="sortable">
2
<div class="sortable-item">Item 1</div>
3
<div class="sortable-item">Item 2</div>
4
<div class="sortable-item">Item 3</div>
5
<div class="sortable-item">Item 4</div>
6
<div class="sortable-item">Item 5</div>
7
</div>
1
1
xxxxxxxxxx
1
const sortable = document.getElementById('sortable');
2
const instanceSortable = DragAndDrop.Sortable.getInstance(sortable);
3
document.addEventListener('itemMove.mdb.sortable', (e) => {
4
console.log(e);
5
console.log(instanceSortable._listElements);
6
});
Console errors: 0