I am trying to get sorted order list when user click on up/down button. Here is my demo link I workout <http://jsfiddle.net/prabud/qy89psbr/>

```
function sendOrderToServer() {
  var items = $(".collection").sortable('toArray');
  var itemList = jQuery.grep(items, function(n, i){
                return (n !== "" && n != null);
        });
}

$(".collection").sortable({ items: ".item" });

$('button').click(function() { 
  var btn = $(this);
  var val = btn.val();
  if (val == 'up')
    moveUp(btn.parents('.item'));
  else
    moveDown(btn.parents('.item'));

  sendOrderToServer();
});

```

Finally I am getting wrong out and It's not in the user's selected order. 

Please suggest me the right way to get sorted order list.