I\'d like to be able to subscribe to the events that are raised during a Sortable drag and drop operation (New in 3.6 Sortable Rows) as I need to persist this information ba
Current implementation that works is
$('#favoriteGrid').bind("sortstart", function (event, ui) {
// I had no need for this action
});
$('#favoriteGrid').bind("sortstop", function (event, ui) {
var lista = jQuery("#favoriteGrid").getDataIDs();
var items = [];
for (i = 0; i < lista.length; i++) {
var rowData = jQuery("#favoriteGrid").getRowData(lista[i]);
items.push({ productId: rowData.ProductId, rowNum: i });
}
var fromFolder = $("#favorite-products > a.selected").attr("data-folderId");
var payload = { FolderId: fromFolder, Items: items };
$.blockUI({ message: '
Saving your sort order...
' });
$.ajax({
type: "POST",
url: "/xxx/yyy/zzz/",
data: JSON.stringify(payload),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
$("#favoriteStatusMessages").html(data)
$.unblockUI();
},
failure: function (errMsg) {
$("#favoriteStatusMessages").html(errMsg).addClass("ui-state-error");
$.unblockUI();
}
});
});