How to get the parent id when the child is sort
<p>This question is related to this: <a href="http://stackoverflow.com/questions/15425213/how-to-display-the-new-order-of-the-parent-after-sorting">How to display the new order of the parent after sorting?</a></p>

<p>I already solved the above question. Now is I want to get the parent id when the child is sort.</p>

<p>Example: When I swap Water to Electricity,</p>

<pre><code>         &lt;li id="1"&gt;
            &lt;span class="cat-title"&gt;Utilities&lt;/span&gt;
            &lt;ul class="dropenv mt"&gt;
                &lt;li class="innerList"&gt;Electricity&lt;/li&gt;
                &lt;li class="innerList"&gt;Water&lt;/li&gt;
                &lt;li class="innerList"&gt;Trash&lt;/li&gt;
                &lt;li class="innerList"&gt;Television&lt;/li&gt;
            &lt;/ul&gt;
         &lt;/li&gt;
</code></pre>

<p>the output must be,</p>

<pre><code>   1_Electricity
   1_Water
   1_Trash
   1_Television
</code></pre>

<p>because 1 is the id of Utilities</p>

<p><strong>Here are the codes:</strong></p>

<pre><code> [.............]
        var parentID;
        var origColor;
        $(".dropenv").sortable({
            connectWith: "ul.env-data",
            dropOnEmpty: true,
            start: function(event, ui) {
                origColor = ui.item.text();

                //this is the id that produce undefined value
                parentID = ui.item.parent().siblings('li').attr('id');
            },
            stop: function(event, ui) {
                var order = [];

                ui.item.closest('ul').children('li').each(function() {
                    order.push($(this).data('position'));
                    var c = $(this).text();
                    var z = parentID;
                    //if (c === origColor) {
                    //    var z = origTitle;
                    //} else {
                    //    var z = $(this).parent().siblings('.cat-title').text();
                    //}
                    $("#cl").append(z + "_" + c + "&lt;br /\&gt;");
                });
            }
        });

[.............]
</code></pre>

<p>The above codes produce undefined value:</p>

<pre><code>   undefined_Electricity
   undefined_Water
   undefined_Trash
   undefined_Television
</code></pre>

<p>How to get the exact parent id?</p>
