Does anyone know in which order the jQuery sortable events are being triggered?
I'm asking this because I had a problem with
update. It made more sense to me that
update event would come after
stop event but that was not the case.
Is this documented anywhere or did someone investigate this? I couldn't manage to find a proper list and I don't feel like looking through the code just yet.
The order of events is:
create - Triggered when the sortable is created
start - Triggered when sorting starts
activate - Triggered for every connected list on drag start
over - Triggered when a sortable item is moved into a sortable list
sort - Triggered during sorting
change - Triggered during sorting, but only when DOM position has changed
beforeStop - Triggered before sorting stops, placeholder/helper
update - Triggered when stopped sorting and DOM position has changed
deactivate - Triggered before sorting stopped, propagated to all possible connected lists
out - Triggered when a sortable item is moved away from a sortable list
stop - Triggered when sorting has stopped
There are other events which can occur too:
receive/remove - Triggered when items are moved between lists
No idea why this isn't clearer on the jQueryUI site.
Note that, depending upon the event triggered, the ui arguments differs. It's worth looking at the API documentation to be clear what this is and to debug it.
The stop event is the last to be fired. Check here to see all the events of a Jquery sortable element.