title: jQuery Mobile - Popup in nested list view
body: <p>I try to create a listview where elements with no children can have an edit button. When the user clicks to this button a popup menu should appear.</p>
  
  <p><img src="https://i.stack.imgur.com/LetkY.png" alt="enter image description here"></p>
  
  <p>Here is the code inside a singe JQM page.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div data-role="content"&gt;
  &lt;ul data-role="listview"&gt;
      &lt;li&gt;
          &lt;h3&gt;Colors&lt;/h3&gt;
          &lt;ul&gt;
              &lt;li&gt;Blue
                  &lt;p class="edit"&gt;
                      &lt;a href="#" onclick="openEditMenu()" data-role="button"
                          data-icon="gear" data-inline="true" data-iconpos="notext"&gt;Edit&lt;/a&gt;
                  &lt;/p&gt;
              &lt;/li&gt;
              &lt;li&gt;Orange&lt;/li&gt;
              &lt;li&gt;Purple&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;h3&gt;Item&lt;/h3&gt;
          &lt;p class="edit"&gt;
              &lt;a href="#" onclick="openEditMenu()" data-role="button"
                  data-icon="gear" data-inline="true" data-iconpos="notext"&gt;Edit&lt;/a&gt;
          &lt;/p&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div data-role="popup" id="popupMenu"&gt;
      &lt;ul data-role="listview" data-inset="true" &gt;
              &lt;li data-role="divider" data-theme="a"&gt;Edit Element&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Edit&lt;/a&gt;&lt;/li&gt;
              ...
      &lt;/ul&gt;
  &lt;/div&gt;
  &lt;script&gt;
      function openEditMenu() {
          $('#popupMenu').popup('open');
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>On the first level this works like expected. If you navigate to the second level of the nested list, the popup is not shown.</p>
  
  <p>I saw that popups in JQM has to be placed on the same page. It seems that JQM does not find the popup on the subpages of the listview.</p>
  
  <p>Has somebody realized successfully such a solution or it is not possible with the popup feature of JQM 1.2?</p>
  
  <p><a href="http://jsfiddle.net/ynqjw/2/" rel="nofollow noreferrer">On jsfiddle you can find my example code.</a></p>
  
  <p>Thanks for tipps or suggestions.</p>