O'Reilly logo

Developing Windows Store Apps with HTML5 and JavaScript by Rami Sarieddine

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding the ListView control

In the previous chapter we introduced a new set of controls provided by the Windows Library for JavaScript; one of these controls was the ListView control, marked as WinJS.UI.ListView. What this object basically does is displays data items in a customizable list or grid. To create a ListView control, we need to add the data-win-control property to a div element and set its property to WinJS.UI.ListView. In the default.html page, add the following code inside the body tag:

<body>
  <div id="sampleListView" data-win-control="WinJS.UI.ListView">
  </div>
</body>

This will create an empty ListView. So, if we run the app, there will be nothing to see. Since it is a WinJS control, it will not be rendered in the markup until ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required