Sortable on drop event


Topic: Sortable on drop event

cdenby pro asked 6 years ago

is there an event I can use to trigger a write back to the database when performing a sort with the sortable plugin? Something like onDragStop or something like that?


Damian Gemza staff answered 6 years ago

Dear cdenby,

Yes, there exists an event called stop(event, ui) which is fired after a drag event stop.

Please take a look at how you can use it:

$(function () {
      $("#sortable").sortable({
        stop: function(event, ui) {
          console.log('Sortable stop');
        }
      });
    });

Best Regards,

Damian


jraigosazion@gmail.com commented 5 years ago

Do you have full documentation to know the sortable plugin functions?


Grzegorz Bujański staff commented 5 years ago

Hi. You can find everything we have at the moment here: https://mdbootstrap.com/plugins/jquery/sortable/


BenLevy commented 5 years ago

After a bit of research, this is just the jquery-ui plugin.

You may want to use the change event. This is only triggered if the sort changes.

Full docs of all events at: https://api.jqueryui.com/sortable/#event-change


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.7.4
  • Device: Pc
  • Browser: Chrome
  • OS: Win10
  • Provided sample code: No
  • Provided link: No
Tags