Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Can you show your code, please? Because in my example this function wort correctly. This code in dataExample.js file: </p> <pre><code>(function () { "use strict"; var dataArray = [ { title: "Basic banana", text: "Low-fat frozen yogurt", picture: "images/60banana.png" }, { title: "Banana blast", text: "Ice cream", picture: "images/60banana.png" }, { title: "Marvelous mint", text: "Gelato", picture: "images/60mint.png" }, { title: "Succulent strawberry", text: "Sorbet", picture: "images/60strawberry.png" } ]; var dataList = new WinJS.Binding.List(dataArray); var publicMembers = { itemList: dataList }; WinJS.Namespace.define("DataExample", publicMembers); })(); </code></pre> <p><br> In default.js I create function, which display count of selected items</p> <pre><code>function someFunc(mouseEvent) { var count = document.getElementById("basicListView").winControl.selection.count(); var dlg = new Windows.UI.Popups.MessageDialog(count); dlg.showAsync().operatio; </code></pre> <p>}</p> <p><br> My default.html contains next code:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;title&gt;App1&lt;/title&gt; &lt;!-- WinJS references --&gt; &lt;link href="//Microsoft.WinJS.1.0/css/ui-white.css" rel="stylesheet" /&gt; &lt;script src="//Microsoft.WinJS.1.0/js/base.js"&gt;&lt;/script&gt; &lt;script src="//Microsoft.WinJS.1.0/js/ui.js"&gt;&lt;/script&gt; &lt;!-- App1 references --&gt; &lt;link href="/css/default.css" rel="stylesheet" /&gt; &lt;script src="/js/default.js"&gt;&lt;/script&gt; &lt;script src="/js/dataExample.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;button id="btn" class="ui-button" onclick="someFunc(event)"&gt;click me&lt;/button&gt; &lt;p id="button1Output"&gt;&lt;/p&gt; &lt;div id="basicListView" data-win-control="WinJS.UI.ListView" data-win-options="{ itemDataSource : DataExample.itemList.dataSource }"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><br> I use <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465496.aspx" rel="nofollow">this MSDN example</a></p>
    singulars
    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.
    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