PHP jQuery update sortable nested menu
<p>I have a nested menu it is a menu with submenus. I am trying to make an interface with jquery sortable <a href="http://jqueryui.com/sortable/#portlets" rel="nofollow">http://jqueryui.com/sortable/#portlets</a> </p>

<p>You can sort the menu this works but I want to save the changes. My database looks like this:</p>

<pre><code>+---------+-----------+------+
| item_id | parent_id | name |
+---------+-----------+------+
| 1       | 0         | Home |
+---------+-----------+------+
| 2       | 0         | Test |
+---------+-----------+------+
| 3       | 2         | Bla  |
+---------+-----------+------+
| 4       | 0         | Baa  |
+---------+-----------+------+
</code></pre>

<p>My sortable menu looks like</p>

<pre><code>&lt;div class="column"&gt;
  &lt;div class="portlet"&gt;
    &lt;div class="portlet-header"&gt;Home&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class="column"&gt;
  &lt;div class="portlet"&gt;
&lt;div class="portlet-header"&gt;Test&lt;/div&gt;
  &lt;/div&gt;

  &lt;div class="portlet"&gt;
&lt;div class="portlet-header"&gt;Bla&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class="column"&gt;
  &lt;div class="portlet"&gt;
&lt;div class="portlet-header"&gt;Baa&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>My jQuery looks like </p>

<pre><code>$(function() {
  $( ".column" ).sortable({
    connectWith: ".column",
    update: function() {
    }    

  });

  $( ".portlet" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
    .find( ".portlet-header" )
    .addClass( "ui-widget-header ui-corner-all" )
    .end()
});
</code></pre>

<p>How can I found out what the new position is of the menu item?</p>
