Interacting with an ItemContainer

The whole point of the ItemContainer is that it makes it content interactive; you can invoke, select, and drag ItemContainers.

By default, when you click an ItemContainer then the iteminvoked event is raised. Imagine that you have created the three options in Listing 7.1.

LISTING 7.1 Invoking an ItemContainer (itemInvoke\itemInvoke.html)

<div class="option" data-option="option 1" data-win-control="WinJS.UI.ItemContainer">    Option 1</div><div class="option" data-option="option 2" data-win-control="WinJS.UI.ItemContainer">    Option 2</div><div class="option" data-option="option 3" data-win-control="WinJS.UI.ItemContainer">    Option 3</div>

Notice that I added a data-option attribute ...

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.