Interface ISelection

Represents a selection of ListView items.

Index

Methods

Methods

public add(items: any): Promise

Adds one or more items to the selection.

Parameters

  • items: any

    The indexes or keys of the items to add. 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.

Returns

Promise

A Promise that is fulfilled when the operation completes.

public clear(): Promise

Clears the selection.

Returns

Promise

A Promise that is fulfilled when the clear operation completes.

public count(): number

Returns the number of items in the selection.

Returns

number

The number of items in the selection.

public getIndices(): Array<number>

Returns a list of the indexes for the items in the selection.

Returns

Array<number>

The list of indexes for the items in the selection as an array of Number objects.

public getItems(): Promise

Returns an array that contains the items in the selection.

Returns

Promise

A Promise that contains an array of the requested IItem objects.

public getRanges(): ISelectionRange[]

Gets an array of the index ranges for the selected items.

Returns

ISelectionRange[]

An array that contains an ISelectionRange object for each index range in the selection.

public isEverything(): boolean

Returns a value that indicates whether the selection contains every item in the data source.

Returns

boolean

true if the selection contains every item in the data source; otherwise, false.

public remove(items: any): Promise

Removes the specified items from the selection.

Parameters

  • items: any

    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.

Returns

Promise

A Promise that is fulfilled when the operation completes.

public selectAll()

Adds all the items in the ListView to the selection.

public set(items: any): Promise

Clears the current selection and replaces it with the specified items.

Parameters

  • items: any

    The indexes or keys of the items that make up the selection. 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.

Returns

Promise

A Promise that is fulfilled when the operation completes.