Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WinJS.UI.ItemContainer object

Applies to Windows and Windows Phone

Defines an item that can be pressed, swiped, and dragged.

Syntax


<div 
    data-win-control="WinJS.UI.ItemContainer">
</div>


var object = new WinJS.UI.ItemContainer();

Members

The ItemContainer object has these types of members:

Constructors

The ItemContainer object has these constructors.

ConstructorDescription
ItemContainer

Creates a new ItemContainer.

 

Events

The ItemContainer object has these events.

EventDescription
oninvoked

Raised when the item is invoked. (You can use the tapBehavior property to specify whether taps and clicks invoke the item.)

onselectionchanged

Raised after the item is selected or deselected.

onselectionchanging

Raised just before the current selection changes.

 

Methods

The ItemContainer object has these methods.

MethodDescription
addEventListener

Registers an event handler for the specified event.

dispatchEvent

Raises an event of the specified type and with additional properties.

dispose

Releases resources held by this ItemContainer. Call this method when the ItemContainer is no longer needed. After calling this method, the ItemContainer becomes unusable.

forceLayout

Forces the ItemContainer to update its layout. Call this function when the reading direction of the app changes after the control has been initialized.

removeEventListener

Removes an event handler that the addEventListener method registered.

 

Properties

The ItemContainer object has these properties.

PropertyAccess typeDescription

draggable

Read/write

Gets or sets a value that specifies whether the item can be dragged.

element

Read-only

Gets the element that hosts this ItemContainer.

selected

Read/write

Gets or sets a value that specifies whether the item is selected.

selectionDisabled

Read/write

Gets or sets a value that specifies whether selection of this item is disabled.

swipeBehavior

Read/write

Gets or sets how the ItemContainer reacts to the swipe gesture. The swipe gesture can select the swiped items or can have no effect on the current selection.

swipeOrientation

Read/write

Gets or sets the orientation of swipe gestures.

tapBehavior

Read/write

Gets or sets how the ItemContainer reacts when the user taps or clicks an item.

 

Remarks

For the ItemContainer to be accessible, its host div element must have its role attribute set to "list" or "listbox". If tapBehavior is set to none and selectionDisabled is true, then use the "list" role; otherwise, use the "listbox" role. The aria-multiselectable attribute of the parent <div> must be set to 'true' as well.

Requirements

Minimum supported client

Windows 8.1 [Windows Store apps only]

Minimum supported server

Windows Server 2012 R2 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.UI

Library

Ui.js

 

 

Show:
© 2014 Microsoft