title: How to retrieve parent container ID after sorting using Jquery sortable?
body: <p>I have following markup and javascript to sort some items. Items can be sorted within a block or across other blocks. It works but I have a problem in retrieving correct block ID after an item is moved from one block to another. </p>
  
  <p>For example, if I move item 1 within "Block 1", I get "I am in Block= block_1" but if I move Item 1 to Block 2 I still get I am in Block 1. </p>
  
  <p>But I want to make the block 2 as its parent container. I need to retrieve this id so that I can do some ajax and update the db accordingly. </p>
  
  <p><strong>Can you please help me correct this??</strong></p>
  
  <pre><code>&lt;div id="blocks_sortable"&gt;
      &lt;div id="block_1"&gt;
          &lt;h2&gt;Block 1&lt;/h2&gt;
  
          &lt;div class="items_sortable connectedSortable"&gt;
              &lt;div id="item_1"&gt; 
                  &lt;span&gt;Item 1&lt;/span&gt;&lt;/div&gt;   
              &lt;div id="item_2"&gt; 
                  &lt;span&gt;Item 2&lt;/span&gt;&lt;/div&gt;
              &lt;div id="item_3"&gt; 
                  &lt;span&gt;Item 3&lt;/span&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;  
      &lt;div id="block_2"&gt;
          &lt;h2&gt;Block 2&lt;/h2&gt;
  
          &lt;div class="items_sortable connectedSortable"&gt;
              &lt;div id="item_4"&gt; 
                  &lt;span&gt;Item 4&lt;/span&gt;&lt;/div&gt;   
              &lt;div id="item_5"&gt; 
                  &lt;span&gt;Item 5&lt;/span&gt;&lt;/div&gt;
              &lt;div id="item_6"&gt; 
                  &lt;span&gt;Item 6&lt;/span&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
  $("#blocks_sortable").sortable({ });
  $(".items_sortable").sortable({
       connectWith: '.connectedSortable'
      , forcePlaceholderSize: true
      ,         stop : function(event, ui){
                      alert("I am in block = "+$(this).parent().attr("id"));
                  }
  }).disableSelection();      
  &lt;/script&gt;
  </code></pre>
  
  <p>Thank you.</p>