
$(function() {
    $(".sortable").sortable({ distance: 25,
        placeholder: 'ui-state-highlight',
        update: function() { sortUpdate($(this).attr('id')); }
    });
    $(".sortable").disableSelection();
});

function sortUpdate(prefix) {
    var sorted = $(".edit-row[title=" + prefix + "]");
    var ids = '';
    jQuery.each(sorted, function() {
        var cur_id = $(this).attr('id');
        ids += cur_id + " ";
    });
    var url = $("#sortUpdateUri-" + prefix).attr('value');
    $.post(url, { ids: ids });
}

$(document).ready(function() {

});