title: Custom data in jQuery sortable?
body: <p>on the "update" callback you can get the order of elements with <code>$(this).sortable('toArray');</code></p>
  
  <p>But this order contains the element IDs.</p>
  
  <p>How can I get a custom attribute, like <code>data-myattr</code>? I want that order to contain values from this attibute instead of IDs....</p>
  
  <pre><code>   $('ul').sortable({
       handle: 'h2'
       items: 'li',
       context: this,
       update: function(){        
  
         var order = $(this).sortable('toArray');
  
         // here I want a array of values from my attribute, not ID values...
         alert(order);
  
         ....
  
       }
     });
  </code></pre>
  
  <p>The HTML is simple:</p>
  
  <pre><code>&lt;ul&gt;
    &lt;li data-myattr="a-1" id="whatever"&gt;
      ...
    &lt;/li&gt;
    ...
  </code></pre>