ListView.currentItem property

0 out of 2 rated this helpful - Rate this topic

Gets or sets an object that indicates which item should get keyboard focus and its focus state.

Syntax


<div data-win-control="WinJS.UI.ListView" data-win-options="{ currentItem : value}">
</div>


var currentItem = listView.currentItem;
listView.currentItem = currentItem;

Property value

Type: Object

An object that contains these properties:

index

Type: Number

The index of the current item in the itemDataSource , or -1 if there is no currently focused item.

key

Type: String

The IItem.key that identifies the item in the itemDataSource, or null if there is no currently focused item.

hasFocus

Type: Boolean

When getting this property, this value is true if the item already has focus; otherwise, it's false. When setting this property, set this value to true if the item should get focus immediately; otherwise, set it to false and the item will get focus eventually.

showFocus

Type: Boolean

true if the item displays the focus rectangle; otherwise, false.

Remarks

To obtain the items that are currently selected, use the selection property.

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Namespace

WinJS.UI

Library

Ui.js

See also

ListView

 

 

Build date: 12/5/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.