Reputation: 26997
im trying to implement a nice gui for organizing posts. i want to use jQuery UI's sortable so the user can drag/drop. i have a column for each post in my database "display order" that i sort by
how can i effectively translate what jquery does to the display_order columns in my db?
Upvotes: 4
Views: 1601
Reputation: 68046
One step at the time
edit
but how do I also get the unique IDs
See #2.
var rank = 1;
$('.my-element').each(function() {
$(this).find('input.rank').val(rank++);
});
As for 'expensive', that's your choice. You can add 'save' button, as I noted above.
Upvotes: 4