Skip to main content

getId()

returns the id of a selected item

getId(): string | string[];

Returns:

The id of a selected item.

Example

var id = component.selection.getId(); // -> "2"
note

The method can be used in the DataView, List, Tree components.

Starting from v7.0, the method can also return an array with ids of selected items if the multiselection property of List or DataView is enabled.