title: jQuery.sortable. change the order by JavaScript
body: <p>How can I change the order of a list once applied by JavaScript <code>jQuery.sortable</code>.</p>
  
  <p>For example:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;ul id="mylist"&gt;
    &lt;li&gt;1&lt;/li&gt;
    &lt;li&gt;2&lt;/li&gt;
    &lt;li&gt;3&lt;/li&gt;
    &lt;li&gt;4&lt;/li&gt;
    &lt;li&gt;5&lt;/li&gt;
  &lt;/ul&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <pre><code>var x_sortable_list = $("mylist").sortable();
  </code></pre>
  
  <p>Then, assuming this to work:</p>
  
  <pre><code>x_sortable_list.changeOrder([
   {item:1, newOrder:2 },
   {item:2, newOrder:1 },
   {item:3, newOrder:3 }
  ]);
  </code></pre>