Here is an interesting use of JavaScript: reordering items with drag and drop. The implementation itself in my page works fine, but is there a way to determine in which orde
HTML
- Item 1
- Item 2
- Item 3
- Item 4
- Item 5
JQUERY
$("#sortable").sortable(
{
update: function () {
var strItems = "";
$("#sortable").children().each(function (i) {
var li = $(this);
strItems += li.attr("id") + ':' + i + ',';
});
updateSortOrderJS(strItems); <--- do something with this data
}
});
strItems will look like (new-item-order:item-id)
0,49:1,365:2,50:3,364:4,366:5,39:6
then you can parse it into an update functions something like
List eachTask = new List(itemsList.Trim().Split(new char[] { ',' }));
then
String[] item = i.Split(new Char[] { ':' });