# rowMoved

Emitted when row order changes. Read the affected row and before/after indices.

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

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

## What does this API do?

Emitted when row order changes. Read the affected row and before/after indices.

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

## Exact input and result types

```typescript
rowMoved: { fromIndex: number; toIndex: number; row: unknown }
```

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

## Usage flow

Subscribe with grid.addEventListener('rowMoved', 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('rowMoved', event => {
  console.log(event.detail);
}, { signal: controller.signal });
// On view disposal: controller.abort();
```

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

## Feature explanations and examples

- [Row dragging](https://grid.syidax.com/docs/features/row-drag.md) — Managed row dragging applies user-defined order to Grid data. Manual reordering can conflict with display order determined by sorting.
