One step at a time
- Attach the exchange handler to the ui sort.
- Each time the order changes, scroll through the elements and recount their positions.
- Save the new position data using an ajax request or add a “Save” button for the user to do this later.
. № 2.
var rank = 1;
$('.my-element').each(function() {
$(this).find('input.rank').val(rank++);
});
"", . "", .