EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

WinJS.UI.SelectionMode enumeration

Applies to Windows and Windows Phone

Specifies the selection mode of a ListView.

Syntax


var WinJS.UI.SelectionMode = {
  none : "none", 
  single : "single", 
  multi : "multi"
}

Members

The SelectionMode enumeration has these members.

MemberValueDescription
none"none"

Items can't be selected.

single"single"

A single item can be selected.

multi"multi"

Multiple items may be selected. Clicking additional items adds them to the selection.

Remarks

Do not set a ListView control's TapBehavior property to "directSelect" when its SelectionMode is set to "none".

Examples

The following example sets the selection mode so that only a single item can be selected.


<div id="basicListView" 
    data-win-control="WinJS.UI.ListView"
    data-win-options="{ itemDataSource : DataExample.itemList.dataSource, itemTemplate: mediumListIconTextTemplate, selectionMode: 'single'}">
</div> 

(For the complete code that creates the ListView in this example, see the Quickstart: Adding a ListView topic.)

The next example shows how to set the selectionMode of the ListView in JavaScript.


var myListView = document.getElementById("basicListView1").winControl;
myListView.selectionMode = WinJS.UI.SelectionMode.single;

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.UI

Library

Ui.js

See also

Quickstart: Adding a ListView

 

 

Anzeigen:
© 2014 Microsoft