Share via


ISelection.remove method

Removes the specified items from the selection.

Syntax

iSelection.remove(items).done( /* Your success and error handlers */ );

Parameters

  • items
    Type: Object

    The indexes or keys of the items to remove. You can provide different types of objects for the items parameter: you can specify an index, a key, or a range of indexes. It can also be an array that contains one or more of these objects. For more info, see the Remarks section.

Return value

Type: Promise**

A Promise that is fulfilled when the operation completes.

Remarks

The items parameter can be an index, a key, or a range of indexes, or an array that contains one or more of these objects.

  • An index: a numeric index value (Number)

    The remove method removes the item at the specified index (the value of items) from the selection.

  • An index: an object that contains an index property that contains a Number

    The remove method removes the item at the specified index (the value of items.index) from the selection.

  • A key: an object that contains a key property

    If the itemDataSource supports keys, the remove method removes the item that has the specified key (the value of items.key) from the selection.

  • A range of indexes or keys: an object that implements ISelectionRange

    • If the object contains firstKey and lastKey values, the remove method removes the items in the specified range from the selection, starting with the item at firstKey and ending with the item at lastKey.

    • If the object contains firstIndex and lastIndex values, the remove method removes the items in the specified index range from the selection, starting with the item at firstIndex and ending with the item at lastIndex.

    • If the object contains both index and key values, the remove method uses the key values.

Requirements

Minimum WinJS version

WinJS 3.0

Namespace

WinJS.UI

See also

ISelection

ListView.selection