title: Jquery sortable using UP / Down button
body: <p>I am trying to get sorted order list when user click on up/down button. Here is my demo  link I workout <a href="http://jsfiddle.net/prabud/qy89psbr/" rel="nofollow">http://jsfiddle.net/prabud/qy89psbr/</a></p>
  
  <pre><code>function sendOrderToServer() {
    var items = $(".collection").sortable('toArray');
    var itemList = jQuery.grep(items, function(n, i){
                  return (n !== "" &amp;&amp; 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();
  });
  </code></pre>
  
  <p>Finally I am getting wrong out and It's not in the user's selected order. </p>
  
  <p>Please suggest me the right way to get sorted order list.</p>