Skip to main content

add()

selects a specified item

add(id: string | number): void;

Parameters:

  • id: string | number - the id of an item

Example

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

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

Starting from v7.0, the method selects all unselected items when calling without parameters (in List/DataView):

component.selection.add();