I know this will be obvious, but I cannot understand.
Im using Rubaxa / sortable and would like to update my DB with ajax when an item is added, deleted or the list is sorted.
var editableList = Sortable.create(document.getElementById('editable'), { animation: 150, filter: '.js-remove', onFilter: function (evt) { evt.item.parentNode.removeChild(evt.item); }, onSort: function(evt) { console.log(editableList.toArray()); // not working } }); document.getElementById('addUser').onclick = function () { Ply.dialog('prompt', { title: 'Add', form: { name: 'name' } }).done(function (ui) { var el = document.createElement('li'); el.innerHTML = ui.data.name + '<i class="js-remove">✖</i>'; editableList.el.appendChild(el); }); };
Any help is appreciated.
source share