# Adaptable Ready Event

Canonical page: https://www.adaptabletools.com/docs/getting-started-adaptable-ready

- Event published by AdapTable as soon as it has initialised
- Use it for setup that must wait until both AdapTable and AG Grid are ready

The Adaptable Ready Event fires when AdapTable has finished initialising and is ready to be accessed.

Use it for setup that must wait until both AdapTable and AG Grid are ready (first search, column sizing, storing the API, and so on).

Do **not** use AG Grid's `gridReady` event for this — it fires **before** AdapTable has initialised

`AdaptableReadyInfo` and how to subscribe in each framework are in the [Getting Started Technical Reference](https://www.adaptabletools.com/docs/technical-reference-getting-started/index.md)

**Example: Adaptable Ready**

Setup that runs when AdapTable has finished initialising

- When AdapTable is ready this demo runs a Quick Search for `react`, autosizes the columns, and shows a System Status message
- The same `onAdaptableReady` handler is used for Vanilla, React, Angular and Vue — switch the framework picker to see each host

- Reload the demo and note the search text, the column widths, and the status message appear as soon as the grid is ready

Demo project (Vanilla); the files without a marker are shown below:

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts        [template]
  gridOptions.ts       [template]
  index.ts             [template]
  onAdaptableReady.ts
  rowData.ts           [template]
  styles.css           [template]
index.html             [template]
package.json           [template]
tsconfig.json          [template]
```

Files marked `[template]` are the same in every demo; see the [demo template](https://www.adaptabletools.com/llms/demo-template.md#vanilla).

**`src/adaptableOptions.ts`**

```ts
import {AdaptableOptions} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'Adaptable Ready',
  initialState: {
    Dashboard: {
      Tabs: [
        {
          Name: 'Demo',
          Toolbars: ['QuickSearch', 'SystemStatus'],
        },
      ],
    },
    Theme: {CurrentTheme: 'dark'},
  },
};
```

**`src/onAdaptableReady.ts`**

```ts
import {AdaptableReadyInfo} from '@adaptabletools/adaptable';

export const onAdaptableReady = ({
  adaptableApi,
  agGridApi,
}: AdaptableReadyInfo) => {
  adaptableApi.quickSearchApi.runQuickSearch('react');
  agGridApi.autoSizeAllColumns();
  adaptableApi.systemStatusApi.setInfoSystemStatus(
    'AdapTable is ready — searched for "react" and autosized columns'
  );
};
```
