Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Replace the below lines inside the <code>showReceipt</code> function:</p> <pre><code>$header = $page.children( ":jqmData(role=header)" ), $content = $page.children( ":jqmData(role=content)" ) </code></pre> <p>with these lines:</p> <pre><code>$header = $page.find( "div:jqmData(role='header')" ), $content = $page.find( "div:jqmData(role='content')" ) </code></pre> <p>and the dialog's content will be updated properly.</p> <p>The issue is probably related to the fact that <a href="http://api.jquery.com/children/" rel="nofollow"><code>.children()</code></a> method travels only one level down the DOM tree. On the other side <code>.find()</code> can travel down multiple levels.</p> <p>As you can see in the below HTML code, the <code>div[data-role='content']</code> is not a first level child of the page's div <code>div[id='receipt']</code>.</p> <pre><code>&lt;div data-role="dialog" id="receipt" data-url="receipt" tabindex="0" class="ui-page ui-body-c ui-dialog ui-overlay-a ui-page-active" style="min-height: 302px;"&gt; &lt;div role="dialog" class="ui-dialog-contain ui-corner-all ui-overlay-shadow"&gt; &lt;div data-role="header" class="ui-corner-top ui-header ui-bar-a" role="banner"&gt; &lt;a data-iconpos="notext" data-icon="delete" href="#" class="ui-btn-left ui-btn ui-btn-up-a ui-shadow ui-btn-corner-all ui-btn-icon-notext" data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-theme="a" title="Close"&gt; &lt;span class="ui-btn-inner ui-btn-corner-all"&gt; &lt;span class="ui-btn-text"&gt; Close &lt;/span&gt; &lt;span class="ui-icon ui-icon-delete ui-icon-shadow"&gt; &amp;nbsp; &lt;/span&gt; &lt;/span&gt; &lt;/a&gt; &lt;h1 class="ui-title" role="heading" aria-level="1"&gt; q0001 &lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content" class="ui-corner-bottom ui-content ui-body-c" role="main"&gt; &lt;p&gt; Receipt Number: q0001 &lt;/p&gt; &lt;ul data-role="listview" class="ui-listview"&gt; &lt;li class="ui-li ui-li-static ui-btn-up-c"&gt; Item: Spaghetti x 3 Total: 150 &lt;/li&gt; &lt;li class="ui-li ui-li-static ui-btn-up-c ui-li-last"&gt; Item: Olive Oil x 1 Total: 1300 &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload