Reputation: 4931
I need order of all the elements like item1=1&item2=2&item3=3
as soon as an element is sorted. here is the js
fiddle for that code. could not paste as link due to indentation error.
Fiddle: jsfiddle.net/8s8t99r7/2/
Upvotes: 0
Views: 130
Reputation: 87203
var order = [],
counter = 1;
$('.sortable').sortable({
connectWith: ".connectedSortable",
cursor: "move",
update: function(event, ui) {
order = [];
counter = 1;
$('.sortable div').each(function() {
order.push($(this).attr('id') + "=" + counter++);
});
alert(order.join('&'));
}
}).disableSelection();
Demo: https://jsfiddle.net/tusharj/8s8t99r7/4/
Upvotes: 1