### File

`packages/components/eui-table/services/eui-table-selectable-row.service.ts`

### Description

Service to manage the selection state of rows in a table. Allows tracking of selected rows and managing selection for individual and multiple rows.

### Index

###### Properties

- Public isAllRowsSelected$
- Public lastSelectedRow
- Public selectedRows$

###### Methods

- Public addRow
- Public addRows
- Public addSelectedRow
- Public addSelectedRows
- Public getLastSelectedRow
- Public getPropId
- Public getRows
- Public removeSelectedRow
- Public resetRows
- Public selectAllRows
- Public selectRows
- Public setPropId
- Public unselectAllRows

### Methods

Public addRow
`addRow(row: any)`

Registers a row as selectable.

Parameters :

Name | Type | Optional | Description
row | `any` | No | Row to register.

Returns : `void`

Public addRows
`addRows(rows: any[])`

Registers a set of rows as selectable.

Parameters :

Name | Type | Optional | Description
rows | `any[]` | No | Set of rows to register.

Returns : `void`

Public addSelectedRow
`addSelectedRow(row: any)`

Selects a row.

Parameters :

Name | Type | Optional | Description
row | `any` | No | Row to select.

Returns : `void`

Public addSelectedRows
`addSelectedRows(rows: any[])`

Selects a set of rows.

Parameters :

Name | Type | Optional | Description
rows | `any[]` | No | Rows to select.

Returns : `void`

Public getLastSelectedRow
`getLastSelectedRow()`
Gets the last selected row. Returns : `any` The last selected row.

Public getPropId
`getPropId()`
Gets the current property name used to identify rows. Returns : `string`

Public getRows
`getRows()`
Unselect all rows. Returns : `any[]`

Public removeSelectedRow
`removeSelectedRow(row: any)`

Unselects a row.

Parameters :

Name | Type | Optional | Description
row | `any` | No | Row to unselect.

Returns : `void`

Public resetRows
`resetRows()`
Unregisters all rows. Returns : `void`

Public selectAllRows
`selectAllRows()`
Select all rows. Returns : `void`

Public selectRows
`selectRows(rows: any[])`

Selects a set of rows.

Parameters :

Name | Type | Optional | Description
rows | `any[]` | No | Rows to select.

Returns : `void`

Public setPropId
`setPropId(value: string)`

Sets the property name used to identify rows as unique.

Parameters :

Name | Type | Optional
value | `string` | No

Returns : `void`

Public unselectAllRows
`unselectAllRows()`
Unselect all rows. Returns : `void`

### Properties

Public isAllRowsSelected$
Type : `BehaviorSubject<boolean>`
Default value : `new BehaviorSubject(false)`
BehaviorSubject containing the state of whether all rows are selected.

Public lastSelectedRow
Type : `any`
Default value : `null`

Public selectedRows$
Type : `BehaviorSubject<any[]>`
Default value : `new BehaviorSubject([])`
BehaviorSubject containing the selected rows.

# results matching ""

# No results matching ""