Note that there are some explanatory texts on larger screens.

plurals
  1. POWinJS.UI.ListView not working in snapped view
    text
    copied!<p>I am using a <code>WinJS.UI.ListView</code> in a JavaScript project for Windows-8 Metro interface.</p> <p>This is the HTML code:</p> <pre><code>&lt;div id="myMain"&gt; &lt;div id="myListTemplate" data-win-control="WinJS.Binding.Template"&gt; &lt;div class="myListViewItem"&gt; &lt;p data-win-bind="innerText: description"&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="myListView" data-win-control="WinJS.UI.ListView" data-win-options="{ itemTemplate: myTemplate, layout: {type: WinJS.UI.ListLayout} }"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And part of the JavaScript:</p> <pre><code>ready: function (element, options) { // Set up the ListView. var myLView = myListView.winControl; WinJS.UI.setOptions(favoritesLView, { itemDataSource: dataSource, oniteminvoked: this.onItemInvoked.bind(this), selectionMode: WinJS.UI.SelectionMode.none }); }, </code></pre> <p>Where <code>dataSource</code> is where the list information is stored. It is a list obtained from: <code>var myList = new WinJS.Binding.List(myJSONarray);</code></p> <p>The code is working in landscape and portrait view, but doesn't work when in snapped view. The list view appears empty despite <code>myList</code> has all the elements.</p> <p>Is this a bug in Windows 8? Anybody know of a workaround to solve it? I have found this link with the same problem but its solution doesn't work for me: <a href="http://social.msdn.microsoft.com/Forums/pl-PL/winappswithhtml5/thread/ce8c722d-526b-4226-9e40-642ddb37422b" rel="nofollow">http://social.msdn.microsoft.com/Forums/pl-PL/winappswithhtml5/thread/ce8c722d-526b-4226-9e40-642ddb37422b</a></p>
 

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