Topic: Sortable on drop event

cdenby pro asked 5 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 5 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


jraigosaziongmail-com free commented 4 years ago

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


Grzegorz Bujański staff commented 4 years ago

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


BenLevy free commented 4 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

  • ForumUser: 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