# sortChanged

Emitted when sorting changes. Reflect the current model in app query conditions or saved view state.

Canonical: https://grid.syidax.com/docs/events/sortChanged/

<a id="meaning"></a>

## What does this API do?

Emitted when sorting changes. Reflect the current model in app query conditions or saved view state.

<a id="contract"></a>

## Exact input and result types

```typescript
sortChanged: GridSortChangedDetail
```

<a id="usage"></a>

## Usage flow

Subscribe with grid.addEventListener('sortChanged', handler). The result is in event.detail, and event names are case-sensitive. Remove subscriptions when disposing of the view.

```javascript
const controller = new AbortController();
grid.addEventListener('sortChanged', event => {
  console.log(event.detail);
}, { signal: controller.signal });
// On view disposal: controller.abort();
```

<a id="types"></a>

## Read related types

- [GridSortChangedDetail](https://grid.syidax.com/docs/types/GridSortChangedDetail.md)

<a id="recipes"></a>

## Feature explanations and examples

- [Single and multiple sorting](https://grid.syidax.com/docs/features/sorting.md) — Sorting changes display order without modifying data values. Single sorting uses one criterion; multiple sorting uses prioritized criteria.
