title: jQuery sortable get .index() before and after sorting?
body: <p>I am using jQuery's sortable on a tagging plugin,
  The plugin maintains an array of objects that relate to the <code>li</code>'s in the same order as the actual items.</p>
  
  <p>I need to update the order of the items in the array when the sorting finishes.</p>
  
  <p>I thought I would just be able to in the start event call <code>$(ui).index()</code> and in the update event call the same which would give me the initial position, and the final position, but both calls return <code>-1</code>.</p>
  
  <p>How should I do this?
  <hr />
  <strong>Structure:</strong></p>
  
  <pre><code>&lt;ul&gt;
  &lt;li&gt;here&lt;a class="close"&gt;x&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;are&lt;a class="close"&gt;x&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;some&lt;a class="close"&gt;x&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;tags&lt;a class="close"&gt;x&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p><strong>Array Structure:</strong></p>
  
  <pre><code>[{
      label: 'here',
      value: 36,
      element: '$(the li that this info is about)',
      index: 0
  },
  {
      label: 'are',
      value: 42,
      element: '$(the li that this info is about)',
      index: 1
  },
  {
      label: 'some',
      value: 21,
      element: '$(the li that this info is about)',
      index: 2
  },
  {
      label: 'tags',
      value: 26,
      element: '$(the li that this info is about)',
      index: 3
  }]
  </code></pre>
  
  <p><strong>JavaScript:</strong></p>
  
  <pre><code>$('ul').sortable({
      start: function(event, ui){...},
      update: function(event, ui){...}
  });
  </code></pre>