### File

`packages/components/eui-table/services/eui-table-sort.service.ts`

### Description

Service to manage the sorting state of columns in a table. Uses a `BehaviorSubject` to store and emit the current sorting values.

### Index

###### Properties

- Public multisortParamsChange$
- Public multisortParamsSort$
- Public sortingParams$

###### Methods

- addMultisortParam
- setMultiSortColumns
- setSort
- toFormGroup

### Methods

addMultisortParam
`addMultisortParam(column: MultisortParam)`

Add a column to the sorting.

Parameters :

Name | Type | Optional | Description
column | `MultisortParam` | No | The column to add to the sorting.

Returns : `void`

setMultiSortColumns
`setMultiSortColumns(multisortParams: MultisortParam[])`

Sets the ordering on multiple columns.

Parameters :

Name | Type | Optional | Description
multisortParams | `MultisortParam[]` | No | Name, order and position of the columns in the sort sequence.

Returns : `void`

setSort
`setSort(sort: string | null, order: "asc" | "desc" | null)`

Sets the ordering order for a given column

Parameters :

Name | Type | Optional | Description
sort | `string | null` | No | The name of the column to sort.
order | `"asc" | "desc" | null` | No | The sorting order (ascending or descending).

Returns : `void`

toFormGroup
`toFormGroup(params: MultisortParam[])`

Add a new select to the form displayed in the dropdown to configure the sorting.

Parameters :

Name | Type | Optional | Description
params | `MultisortParam[]` | No | The current sorting configuration.

Returns : `FormArray`

The form group with the selects.

### Properties

Public multisortParamsChange$
Default value : `new BehaviorSubject([])`

Public multisortParamsSort$
Default value : `new BehaviorSubject([])`

Public sortingParams$
Default value : `new BehaviorSubject({ sort: null, order: 'desc' })`
BehaviorSubject containing the current sorting information.

# results matching ""

# No results matching ""