Skip to main content

TableSelectionMulti

<ui5-table-selection-multi> | Since 2.8.0

The ui5-table-selection-multi component is used inside the ui5-table to add multi-selection capabilities to the ui5-table. Since selection is key-based, each ui5-table-row must define a unique row-key property.

Usage

The ui5-table-selection-multi component is a feature designed exclusively for use within the ui5-table component. It must be placed inside the features slot of ui5-table. This component is not intended for standalone use.

<ui5-table>
<ui5-table-selection-multi slot="features" selected="Row1 Row3"></ui5-table-selection-multi>
</ui5-table>

ES6 Module Import

import "@ui5/webcomponents/dist/TableSelectionMulti.js";

Properties

selected

DescriptionDefines the row-key values of selected rows, with each value separated by a space.
Typestring | undefined
Defaultundefined

headerSelector

DescriptionDefines the selector of the header row.
Type"SelectAll" | "ClearAll"
Default"SelectAll"
Since2.12

behavior

DescriptionDefines the selection behavior.
Type"RowSelector" | "RowOnly"
Default"RowSelector"
Since2.11

Slots

No slots available for this component.

Events

change

DescriptionFired when the selection is changed by user interaction.
TypeCustomEvent
BubblesYes
CancelableNo

Methods

getSelectedRows

DescriptionReturns an array of the selected rows.
Return typeArray<TableRow>

getSelectedAsSet

DescriptionReturns the selected property as a set of unique row-key values.
Return typeSet<string>

setSelectedAsSet

DescriptionSets the selected property using the provided set of unique row-key values.
Return typevoid
ParametersselectedSet: Set<string>
A set of row-key values

getRowByKey

DescriptionReturns the table row instance for the given row key.
Return typeTableRow | undefined
ParametersrowKey: string
The row key

CSS Parts

No CSS parts available for this component.

Basic Sample

Enable multi-selection in your table by adding the <ui5-table-selection-multi> feature.

The selection features of the table is key-based, therefore each row requires a row-key attribute to be uniquely identified.