Handle the Related Events

To execute certain commands when an item changes its position, handle the itemReordered event. If the event handling function is not going to be changed during the lifetime of the widget, assign it to the onItemReordered option when you configure the widget.

$(function () {
        // ...
        onItemReordered: function(e) {
            var itemData = e.itemData;
            var itemDomNode = e.itemElement;
            var from = e.fromIndex;
            var to = e.toIndex;
            // Handler of the "itemReordered" event

If you are going to change the itemReordered event handler at runtime, or if you need to attach several handlers to this event, subscribe to it using the on(eventName, eventHandler) method.

var itemReorderedEventHandler1 = function(e) {
    // First handler of the "itemReordered" event

var itemReorderedEventHandler2 = function(e) {
    // Second handler of the "itemReordered" event

    .on("itemReordered", itemReorderedEventHandler1)
    .on("itemReordered", itemReorderedEventHandler2);
See Also