vishalok12 / jquery-dragarrange

A Basic jQuery library to arrange/order DOM elements by dragging http://vishalok12.github.io/jquery-dragarrange/
MIT License
40 stars 18 forks source link

How to fire jquery event after drag and drop? #13

Open shahujvaln opened 6 years ago

shahujvaln commented 6 years ago

Hi,

I want to pull sort order as soon as I drop. Don't want to put any button for same. Is there any function available to identify sort order after drop?

$(function () { $('.draggable-element').arrangeable({ dragEndEvent: function () { alert("Hello"); } }); });

Above code didn't work.

FrederikStenberg commented 4 years ago

You're trying to call a function directly, but what the plugin wants is a custom event.

$(function () {
  $('.draggable-element').arrangeable({
    dragEndEvent: 'myEvent'
    }
  });
});

$(document).bind('myEvent', function () {
    alert('Hello');
});