Note that there are some explanatory texts on larger screens.

plurals
  1. POJQM Listview Slow on load and Click
    primarykey
    data
    text
    <p>I recently embarked on the social endevour of creating a transport mobile site for my city of Cape Town, in celebration of transport month. It seems to work well, however I am receiving consistant feedback from users that they are battling with one listview in particular, which is the 'locations' listview loaded into this mutli-page: <a href="http://findmyway.mobi/GoldenArrow/index.aspx" rel="nofollow">http://findmyway.mobi/GoldenArrow/index.aspx</a></p> <p>The list is dynamically created via JSON objects on the page load, and thus I would expect that once the user clicks the locations link to show the list, it should load instantly as it was already created on the initial page load. </p> <p>The lag only seems to be a problem on mobiles and not desktops, and occurs when using the JQM listview-filter, as well as when selecting a list item. Below is the code which generates the listview of locations. This code as you can see runs once, when the multipage is initially loaded, thus it should be easily complete by the time the user clicks on the locations listview. I have simplified the JS, and inserted an APPKey for test use:</p> <pre><code>if (event.type == 'pageinit') { jsonURL = "http://api.wimt.co.za/v1/json/public.svc/" + "GetStopNames?op=metrorail&amp;appKey=" + "9A4A49F1-7051-45C6-B4B1-10DF2C016874"; $.ajax({ url: jsonURL, dataType: 'jsonp', success: function (data) { $.each(data, function (key, val) { items = []; $.each(data['GetStopNamesResult']['Results'], function (index, value) { if (value.charAt(0).toUpperCase() == curChar) { items.push('&lt;li class="ui-btn-icon-left" data-icon="arrow-l"&gt;&lt;a href="#' + provider + '" data-direction="reverse"&gt;' + value + '&lt;/a&gt;'); } else { curChar = value.charAt(0).toUpperCase(); items.push('&lt;li data-role="list-divider"&gt;' + curChar + '&lt;/li&gt;'); items.push('&lt;li class="ui-btn-icon-left" data-icon="arrow-l"&gt;&lt;a href="#' + provider + '" data-direction="reverse"&gt;' + value + '&lt;/a&gt;&lt;/li&gt;'); } }); $('#locList').append(items.join('')); for (i = 0; i &lt; items.length; i++) { items[i].replace('locListIcon', 'destListIcon'); } $('#destList').append(items.join('')); }); }, error: function () {} }); </code></pre> <p>}</p> <p>Here is the HTML which the above JS affects: </p> <pre><code> &lt;!-- Start of Location Selection page --&gt; &lt;div data-role="page" id="GAloc" data-title="Golden Arrow Stop Locations" data-theme="a" data-content-theme="a"&gt; &lt;div data-role="header" data-theme="e"&gt;&lt;h1&gt;Locations&lt;/h1&gt;&lt;a data-rel="back"&gt;Back&lt;/a&gt;&lt;/div&gt; &lt;div data-role="content"&gt; &lt;ul id="locList" data-role="listview" data-inset="true" data-filter="true" data-split-theme="e" data-divider-theme="e"&gt;&lt;/ul&gt; &lt;/div&gt; &lt;div data-role="footer" class="header" data-theme="f"&gt;&lt;img class="banner" src="../img/banner/greenpopBanner.png" alt="http://www.greenpop.org"/&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Its been a crazy 34 day's making this from idea to publish, and this is the last performance related problem I cannot fathom. I hope someone can help me make this right.</p> <p>Kind thanks, Devin</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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