# preDestroyed

Provides state and capture issues before the Grid is destroyed. Use for saving view preferences and cleaning up resources.

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

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

## What does this API do?

Provides state and capture issues before the Grid is destroyed. Use for saving view preferences and cleaning up resources.

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

## Exact input and result types

```typescript
preDestroyed: SyGridPreDestroyedDetail
```

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

## Usage flow

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

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

## Read related types

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

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

## Feature explanations and examples

- [Settings and data fundamentals](https://grid.syidax.com/docs/guides/concepts.md)
- [API calls and event integration](https://grid.syidax.com/docs/guides/data-event-access.md)
