# Providing Column Types

Canonical page: https://www.adaptabletools.com/docs/dev-guide-columns-column-types

- Column Types are provided by Developers using the `type` property in the AG Grid Column Def
- They are leveraged by AdapTable for:
  - Scope — treat all Columns that share a type as a group (e.g. a Format Column)
  - Special Columns — Calculated, FreeText and Action Columns, so AG Grid properties can be applied
  - Hidden Columns — never visible in the Grid
  - Pivot Total Columns
  - FDC3 Columns

Column Types are supplied via the `type` property in an AG Grid Column Schema definition.

- The `type` property accepts an array as well as a single value
- This allows developers to provide their own types as well as those which AdapTable and / or AG Grid expect

The most common use cases for Column Types in AdapTable are Scope, and the AdapTable-recognised types listed below.

## Column Type Scope

Column Types can be used as an option when defining [Scope](https://www.adaptabletools.com/docs/dev-guide-columns-scope/index.md).

- The commonly used `ColumnScope` object sets which Columns are to be included in an AdapTable Object
- You set one Scope for multiple columns when creating [Format Columns](https://www.adaptabletools.com/docs/handbook-column-formatting/index.md), [Alerts](https://www.adaptabletools.com/docs/handbook-alerting/index.md), [Flashing Cells](https://www.adaptabletools.com/docs/handbook-flashing-cell/index.md) and other objects

All columns containing the specified Column Type will be **dynamically** included in the Object's Scope.

- Column Types are **not** automatically available for AdapTable run-time users in the UI and associated wizards
- Use the `columnTypes` property in [Column Options](https://www.adaptabletools.com/docs/technical-reference-column/index.md) to specify which of the supplied Column Types are listed

### `columnTypes`

Optional list of Column Types - used when defining Scope in AdapTable UI & decorating Special Columns

This property in [Column Options](https://www.adaptabletools.com/docs/technical-reference-column/index.md) returns the subset of Column Types defined in AG Grid column definitions that should be available to run-time AdapTable users.

This is particularly useful when defining [Scope](https://www.adaptabletools.com/docs/dev-guide-columns-scope/index.md) - via the object's `Scope` property - for a group of Columns.

It is defined as follows:

```ts
columnTypes?: string[] | ((context: ColumnTypesContext) => string[]);
```

As can be seen the list can be provided in 2 ways:

- via hard-coded array of strings

```ts {4}
// Define 4 Column Types via a list
const adaptableOptions: AdaptableOptions = {
  columnOptions: {
    columnTypes: ['number-column', 'price', 'user', 'decimal']
  }
```

- using a function which receives a [`ColumnTypesContext`](https://www.adaptabletools.com/docs/reference/columntypescontext.md) object and returns an array of strings

```ts {4}
// Define 4 Column Types using a Function
const adaptableOptions: AdaptableOptions = {
  columnOptions: {
    columnTypes: (context: ColumnTypesContext) => ['number-column', 'price', 'user', 'decimal']
  }
```

This can then be put together with objects as follows:

```ts {4,11,18,26}
// Define 3 Column Types and reference them in Format Columns
const adaptableOptions: AdaptableOptions = {
  columnOptions: {
    columnTypes: ['number-column', 'price', 'user', 'decimal']
  }
  initialState : {
    FormatColumn: {
      FormatColumns: [
        {
          Name: 'format-number-center',
          Scope: { ColumnTypes: ['number-column'] },
          Style: {
            Alignment: 'Center',
          },
        },
        {
          Name: 'format-price-four-digits',
          Scope: { ColumnTypes: ['price'] },
          DisplayFormat: {
            Formatter: 'NumberFormatter',
            Options: { FractionDigits: 4 },
          },
        },
        {
          Name: 'format-user-back-colour',
          Scope: { ColumnTypes: ['user'] },
          Style: {
            BackColor: 'var(--ab-color-palette-26)',
            ForeColor: 'var(--ab-color-palette-13)'
          },
        },
      ],
    },
  };
}
```

- When defining the Scope in a Wizard, only the items returned by this property are visible to the run-time user
- Values returned in this property **must exist** in at least one `Type` property in an AG Grid column definition

**Example: Column Type Scope**

Column Scope in Format Columns

- This demo showcases how to use Column Type Scope, through 3 [Format Columns](https://www.adaptabletools.com/docs/handbook-column-formatting/index.md):
  - The 2 Columns with a type of `github` (i.e. `Github Watchers` & `Github Stars`) have a style of bold and centre-aligned
  - The 4 Columns with a type of `issue-pr` (i.e. `Open Issues`, `Closed Issues`, `Open PRs` & `Closed PRs`) have a style of black font on blue background
  - The 2 Calculated Columns (and therefore with a type of `calculatedColumn` - `githubPopularity` & `totalStars`) have a style of pink font and bold
- The 3 types have also been provided in the `columnTypes` property in [Column Options](https://www.adaptabletools.com/docs/technical-reference-column/index.md) so they can be accessed in the UI

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

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts
  gridOptions.ts
  index.ts             [template]
  onAdaptableReady.ts  [template]
  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, AdaptableColumnType} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'Column Type Scope',
  columnOptions: {
    columnTypes: ['github', 'issue-pr', AdaptableColumnType.CalculatedColumn],
  },
  initialState: {
    Dashboard: {ModuleButtons: ['FormatColumn']},
    Theme: {CurrentTheme: 'dark'},
    CalculatedColumn: {
      CalculatedColumns: [
        {
          FriendlyName: 'Popularity',
          ColumnId: 'githubPopularity',
          Expression: '[github_watchers] + [github_stars]',
          CalculatedColumnSettings: {
            DataType: 'number',
          },
        },
        {
          ColumnId: 'totalStars',
          FriendlyName: 'Total Stars',
          Expression: 'SUM{[github_stars]}',
          CalculatedColumnSettings: {
            DataType: 'number',
          },
        },
      ],
    },
    FormatColumn: {
      FormatColumns: [
        {
          Name: 'formatColumn-github',
          Scope: {
            ColumnTypes: ['github'],
          },
          Style: {
            FontWeight: 'Bold',
            Alignment: 'Center',
          },
        },
        {
          Name: 'formatColumn-issue-pr',
          Scope: {
            ColumnTypes: ['issue-pr'],
          },
          Style: {
            BackColor: '#8fd3fe',
            ForeColor: 'var(--ab-color-palette-13)',
          },
        },
        {
          Name: 'formatColumn-CalculatedColumn',
          Scope: {
            ColumnTypes: [AdaptableColumnType.CalculatedColumn],
          },
          Style: {
            ForeColor: 'Pink',
            FontStyle: 'Italic',
          },
        },
      ],
    },
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          Name: 'Standard Layout',
          TableColumns: [
            'name',
            'github_watchers',
            'github_stars',
            'open_issues_count',
            'closed_issues_count',
            'githubPopularity',
            'totalStars',
            'open_pr_count',
            'closed_pr_count',
            'license',
            'week_issue_change',
            'created_at',
            'has_wiki',
            'updated_at',
            'pushed_at',
            'has_projects',
            'has_pages',
          ],
          AutoSizeColumns: true,
        },
      ],
    },
  },
};
```

**`src/columnDefs.ts`**

```ts
import {ColDef} from 'ag-grid-enterprise';
import {WebFramework} from './rowData';

export const columnDefs: ColDef<WebFramework>[] = [
  {
    field: 'name',
    cellDataType: 'text',
    sortable: true,
  },
  {
    field: 'language',
    cellDataType: 'text',
    enablePivot: true,
    enableRowGroup: true,
  },
  {
    field: 'github_stars',
    headerName: 'GitHub Stars',
    cellDataType: 'number',
    type: 'github',
    enableValue: true,
  },
  {
    field: 'github_watchers',
    headerName: 'GitHub Watchers',
    cellDataType: 'number',
    type: 'github',
    enableValue: true,
  },
  {
    field: 'license',
    cellDataType: 'text',
    editable: false,
    enablePivot: true,
    enableRowGroup: true,
  },
  {
    field: 'week_issue_change',
    headerName: 'Issue Change',
    cellDataType: 'number',
    enableValue: true,
  },
  {
    field: 'rating',
    headerName: 'Rating',
    cellDataType: 'number',
    enableValue: true,
  },
  {
    field: 'created_at',
    headerName: 'Created',
    cellDataType: 'date',
  },
  {
    field: 'has_wiki',
    headerName: 'Has Wiki',
    cellDataType: 'boolean',
    enablePivot: true,
    enableRowGroup: true,
  },
  {
    field: 'updated_at',
    headerName: 'Updated',
    cellDataType: 'date',
  },
  {
    field: 'pushed_at',
    headerName: 'Pushed',
    cellDataType: 'date',
  },
  {
    field: 'description',
    cellDataType: 'text',
    sortable: false,
  },
  {
    field: 'open_issues_count',
    headerName: 'Open Issues',
    cellDataType: 'number',
    type: 'issue-pr',
    enableValue: true,
  },
  {
    field: 'closed_issues_count',
    headerName: 'Closed Issues',
    cellDataType: 'number',
    type: 'issue-pr',
    enableValue: true,
  },
  {
    field: 'open_pr_count',
    headerName: 'Open PRs',
    cellDataType: 'number',
    type: 'issue-pr',
    enableValue: true,
  },
  {
    field: 'closed_pr_count',
    headerName: 'Closed PRs',
    cellDataType: 'number',
    type: 'issue-pr',
    enableValue: true,
  },
  {
    field: 'has_projects',
    headerName: 'Has Projects',
    cellDataType: 'boolean',
  },
  {
    field: 'has_pages',
    headerName: 'Has Pages',
    cellDataType: 'boolean',
  },
  {
    field: 'topics',
    cellDataType: 'textArray',
    editable: false,
    sortable: false,
  },
  {
    field: 'id',
    cellDataType: 'number',
    hide: true,
    editable: false,
  },
];
```

**`src/gridOptions.ts`**

```ts
import {GridOptions, themeBalham} from 'ag-grid-enterprise';

import {rowData, WebFramework} from './rowData';
import {columnDefs} from './columnDefs';

export const gridOptions: GridOptions<WebFramework> = {
  theme: themeBalham,
  defaultColDef: {
    resizable: true,
    sortable: true,
    editable: true,
    filter: true,
    floatingFilter: true,
  },
  columnDefs: columnDefs,
  rowData: rowData,
  sideBar: true,
  suppressMenuHide: true,
  columnMenu: 'new',
  cellSelection: true,
  statusBar: {
    statusPanels: [
      {statusPanel: 'agTotalRowCountComponent', align: 'left'},
      {statusPanel: 'agFilteredRowCountComponent'},
      {
        key: 'Center Panel',
        statusPanel: 'AdaptableStatusPanel',
        align: 'center',
      },
    ],
  },
  columnTypes: {
    github: {},
    'issue-pr': {},
  },
};
```

## AdapTable Column Types

AdapTable also recognises these built-in Column Types:

- **Special Columns** — [Calculated](https://www.adaptabletools.com/docs/handbook-calculated-column/index.md), [FreeText](https://www.adaptabletools.com/docs/handbook-freetext-column/index.md) and [Action](https://www.adaptabletools.com/docs/handbook-action-column/index.md) Columns
- **Pivot Total Columns** — [Pivot Totalling](https://www.adaptabletools.com/docs/handbook-layouts-pivot-total-columns/index.md)
- **Hidden Columns** — so they are not [visible in the UI](https://www.adaptabletools.com/docs/dev-guide-columns-hiding-columns/index.md)
- **FDC3 Columns** — [FDC3](https://www.adaptabletools.com/docs/handbook-fdc3/index.md)

There are 9 column type values provided by AdapTable:

- AdapTable helps developers to configure the correct `type` property via Intellisense
- This is done via the `AdaptableColumnType` object enabling, for example:
```ts{2}
Scope: {
  ColumnTypes: [AdaptableColumnType.CalculatedColumn] // instead of 'calculatedColumn'
},
```

| String Equivalent       | AdaptableColumnType Value |
| ----------------------- | ------------------------- |
| `actionColumn`          | ActionColumn              |
| `calculatedColumn`      | CalculatedColumn          |
| `fdc3Column`            | Fdc3Column                |
| `freeTextColumn`        | FreeTextColumn            |
| `hiddenColumn`          | HiddenColumn              |
| `pivotAnyTotal`         | PivotAnyTotal             |
| `pivotGrandTotal`       | PivotGrandTotal           |
| `pivotColumnTotal`      | PivotColumnTotal          |
| `pivotAggregationTotal` | PivotAggregationTotal     |

### Special Columns

The most common use case for using Column Types in AdapTable is when configuring Special Columns:

- [Calculated Columns](https://www.adaptabletools.com/docs/handbook-calculated-column/index.md)
- [FreeText Columns](https://www.adaptabletools.com/docs/handbook-freetext-column/index.md)
- [Action Columns](https://www.adaptabletools.com/docs/handbook-action-column/index.md)

Column Types are used here in 2 separate use cases:

- updating AG Grid Definitions
- providing additional column properties

#### AG Grid Definitions

Sometimes the developer might wish to refer to an AdapTable Special Column when creating Column Schema Definitions in AG Grid `Grid Options`.

- This can be useful if you want to place the Column in a [Column Group](https://www.adaptabletools.com/docs/handbook-grouping-columns/index.md)
- Or if you want to add an AG Grid specific column definition property (e.g. a custom Tooltip component)

AG Grid Columns which will also serve as Special Columns are marked by configuring the `types` property of the Column Definition as follows:

| Special Column                                                              | Value for `type` property |
| --------------------------------------------------------------------------- | ------------------------- |
| [Action Columns](https://www.adaptabletools.com/docs/handbook-action-column/index.md)         | `actionColumn`            |
| [Calculated Columns](https://www.adaptabletools.com/docs/handbook-calculated-column/index.md) | `calculatedColumn`        |
| [FreeText Columns](https://www.adaptabletools.com/docs/handbook-freetext-column/index.md)     | `freeTextColumn`          |

- By default, AdapTable creates a new AG Grid column for each Special Column it encounters
- But in this scenario, it will **update** (patch) the AG Grid column with extra properties as required

### Defining Special Columns in AG Grid

There are 3 main steps you **must** follow in order to wire up AdapTable Special Columns in AG Grid:

Use a full Column Definition as normal.

Add the ColDef to a Column Group if required.

Provide any components (e.g. Tooltip) as needed.

The `colId` value should be the same as that used for `ColumnId` in the Special Column definition

```tsx [[1, 8, "subscribersRatio"], [1, 17, "comments"]]
export const columnDefs: (ColDef | ColGroupDef)[] = [
  {
    groupId: 'demoColGroup',
    headerName: 'Special Columns',
    children: [
      {
        // Create a Calculated Column
        colId: 'subscribersRatio', // has to be same Id as in InitialState
        cellDataType: 'number',
        type: [AdaptableColumnType.CalculatedColumn, 'number-cell'],
        // add a tooltip if required
        tooltip: (params: ITooltipParams) => params.data,
        tooltipComponent: CustomTooltip,
      },
      {
        // Create a Free Text Column
        colId: 'comments', // has to be same Id as in InitialState
        cellDataType: 'text',
        type: AdaptableColumnType.FreeTextColumn,
        headerTooltip: 'Sometimes high, sometimes low',
      },
    ],
  },
];
```

Make sure to add correct value to the `type` property. This should be:

- `calculatedColumn` (or `AdaptableColumnType.CalculatedColumn`) — Calculated Columns
- `freeTextColumn` (or `AdaptableColumnType.FreeTextColumn`) — FreeText Columns
- `actionColumn` (or `AdaptableColumnType.ActionColumn`) — Action Columns

```tsx [[2, 10, "AdaptableColumnType.CalculatedColumn"], [2, 19, "AdaptableColumnType.FreeTextColumn"]]
export const columnDefs: (ColDef | ColGroupDef)[] = [
  {
    groupId: 'demoColGroup',
    headerName: 'Special Columns',
    children: [
      {
        // Create a Calculated Column
        colId: 'subscribersRatio', // has to be same Id as in InitialState
        cellDataType: 'number',
        type: [AdaptableColumnType.CalculatedColumn, 'number-cell'],
        // add a tooltip if required
        tooltip: (params: ITooltipParams) => params.data,
        tooltipComponent: CustomTooltip,
      },
      {
        // Create a Free Text Column
        colId: 'comments',
        cellDataType: 'text',
        type: AdaptableColumnType.FreeTextColumn,
        headerTooltip: 'Sometimes high, sometimes low',
      },
    ],
  },
];
```

Define the Special Columns normally.

AdapTable will then automatically wire up the columns to the existing AG Grid columns.

This will be done in place of the usual practice which is to create a new AG Grid column.

```tsx [[3, 5, "subscribersRatio"], [3, 16, "comments"]]
CalculatedColumn: {
  CalculatedColumns: [
    {
      FriendlyName: 'Subscribers Ratio',
      ColumnId: 'subscribersRatio',
      Expression: '[github_stars] / [github_watchers]',
      CalculatedColumnSettings: {
        DataType: 'number',
      },
    },
  ],
},
FreeTextColumn: {
  FreeTextColumns: [
    {
      ColumnId: 'comments',
      FreeTextColumnSettings: {
        DataType: 'text',
      },
    },
  ],
},
```

**Example: Special Column Types**

Defining 'Special Column' Types in AG Grid

- This demo shows 2 Special Columns that have been predefined in AG Grid:
  - Calculated Column - `Subscribers Ratio`
  - Free Text Column - `Comments`
- Both Columns have been predefined in AG Grid with these features:
  - Placed in a Column Group (called Special Columns)
  - A (cell) Tooltip has been added to the `Subscribers Ratio` column
  - A Header Tooltip has been added to the `Comments` column
- Both Columns have been created in Initial Adaptable State - using **same** value for AG Grid `colId` and AdapTable `ColumnId`

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

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts
  gridOptions.ts
  index.ts             [template]
  onAdaptableReady.ts  [template]
  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: 'AG Grid Defined Special Columns',
  initialState: {
    Dashboard: {
      ModuleButtons: ['CalculatedColumn', 'FreeTextColumn'],
    },
    Theme: {CurrentTheme: 'dark'},
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          TableColumns: [
            'name',
            'language',
            'github_stars',
            'github_watchers',
            'subscribersRatio',
            'comments',
          ],
          Name: 'Standard Layout',
        },
      ],
    },
    CalculatedColumn: {
      CalculatedColumns: [
        {
          FriendlyName: 'Subscribers Ratio',
          ColumnId: 'subscribersRatio',
          Expression: '[github_stars] / [github_watchers]',
          CalculatedColumnSettings: {
            DataType: 'number',
          },
        },
      ],
    },
    FreeTextColumn: {
      FreeTextColumns: [
        {
          ColumnId: 'comments',
          FriendlyName: 'Comments',

          FreeTextStoredValues: [
            {PrimaryKey: 24195339, FreeText: 'Used by the US team'},
            {PrimaryKey: 224663696, FreeText: 'My personal favourite'},
            {PrimaryKey: 82095231, FreeText: 'Required by Support Team'},
          ],
          FreeTextColumnSettings: {
            Aggregatable: false,
            DataType: 'text',
          },
        },
      ],
    },
    FormatColumn: {
      FormatColumns: [
        {
          Name: 'formatColumn-subscribersRatio',
          Scope: {
            ColumnIds: ['subscribersRatio'],
          },
          DisplayFormat: {
            Formatter: 'NumberFormatter',
            Options: {
              FractionDigits: 2,
              Suffix: '%',
            },
          },
        },
      ],
    },
  },
};
```

**`src/columnDefs.ts`**

```ts
import {
  ColDef,
  ColGroupDef,
  ITooltipComp,
  ITooltipParams,
} from 'ag-grid-enterprise';
import {AdaptableColumnType} from '@adaptabletools/adaptable';

class CustomTooltip implements ITooltipComp {
  eGui: any;
  init(params: ITooltipParams & {color: string; backgroundColor: string}) {
    const eGui = (this.eGui = document.createElement('div'));
    const color = params.color || 'black';
    const backgroundColor = params.backgroundColor || 'white';
    const githubstarscount = params.data['github_stars'];
    const githubwatcherscount = params.data['github_watchers'];

    //@ts-ignore
    eGui.style['color'] = color;
    //@ts-ignore
    eGui.style['background-color'] = backgroundColor;
    eGui.style['border'] = '1px solid gray';
    eGui.innerHTML = `
            <p>
                <div> Stars: ${githubstarscount}</div>
                <div> Watchers ${githubwatcherscount}</div>
            </p>
        `;
  }

  getGui() {
    return this.eGui;
  }
}

export const columnDefs: (ColDef | ColGroupDef)[] = [
  {
    field: 'id',
    cellDataType: 'number',
    hide: true,
    editable: false,
  },
  {
    field: 'name',
    cellDataType: 'text',
    sortable: true,
  },
  {
    field: 'language',
    cellDataType: 'text',
    enablePivot: true,
    enableRowGroup: true,
  },
  {
    field: 'github_stars',
    headerName: 'GitHub Stars',
    cellDataType: 'number',
    enableValue: true,
  },
  {
    //   groupId: 'demoColGroup',
    headerName: 'Special Columns',
    children: [
      {
        // it has to be the same ID as for the CalculatedColumn
        colId: 'subscribersRatio',
        // the type has to be specified as 'calculatedColumn' (or [...,'calculatedColumn'])
        type: [AdaptableColumnType.CalculatedColumn],
        cellDataType: 'number',
        tooltip: (params: ITooltipParams) => params.data,
        tooltipComponent: CustomTooltip,
        tooltipComponentParams: {
          color: 'var(--ab-color-accentlight)',
          backgroundColor: 'var(--ab-color-primary-foreground)',
        },
      },
      {
        // it has to be the same ID as for the FreeTextColumn
        colId: 'comments',
        // the type has to be specified as 'freeTextColumn' (or [...,'freeTextColumn'])
        type: AdaptableColumnType.FreeTextColumn,
        cellDataType: 'number',
        headerTooltip:
          'This is a free text column, you can use it to store any data you want',
      },
    ],
  },
  {
    field: 'license',
    cellDataType: 'text',
    editable: false,
    enablePivot: true,
    enableRowGroup: true,
  },
  {
    field: 'created_at',
    headerName: 'Created',
    cellDataType: 'date',
  },
  {
    field: 'has_wiki',
    headerName: 'Has Wiki',
    cellDataType: 'boolean',
    enablePivot: true,
    enableRowGroup: true,
  },
  {
    field: 'updated_at',
    headerName: 'Updated',
    cellDataType: 'date',
  },
  {
    field: 'pushed_at',
    headerName: 'Pushed',
    cellDataType: 'date',
  },
  {
    field: 'github_watchers',
    headerName: 'GitHub Watchers',
    cellDataType: 'number',
    enableValue: true,
  },
  {
    field: 'open_issues_count',
    headerName: 'Open Issues',
    cellDataType: 'number',
    enableValue: true,
  },
  {
    field: 'closed_issues_count',
    headerName: 'Closed Issues',
    cellDataType: 'number',
    enableValue: true,
  },
  {
    field: 'open_pr_count',
    headerName: 'Open PRs',
    cellDataType: 'number',
    enableValue: true,
  },
  {
    field: 'closed_pr_count',
    headerName: 'Closed PRs',
    cellDataType: 'number',
    enableValue: true,
  },
  {field: 'has_projects', headerName: 'Has Projects', cellDataType: 'boolean'},
  {field: 'has_pages', headerName: 'Has Pages', cellDataType: 'boolean'},
  {
    field: 'week_issue_change',
    headerName: 'Issue Change',
    cellDataType: 'number',
    enableValue: true,
  },
];
```

**`src/gridOptions.ts`**

```ts
import {GridOptions, themeBalham} from 'ag-grid-enterprise';

import {rowData} from './rowData';
import {columnDefs} from './columnDefs';

export const gridOptions: GridOptions = {
  theme: themeBalham,
  defaultColDef: {
    resizable: true,
    sortable: true,
    editable: true,
    filter: true,
    floatingFilter: true,
  },
  columnDefs: columnDefs,
  rowData: rowData,
  sideBar: true,
  suppressMenuHide: true,
  cellSelection: true,
  statusBar: {
    statusPanels: [
      {statusPanel: 'agTotalRowCountComponent', align: 'left'},
      {statusPanel: 'agFilteredRowCountComponent'},
      {
        key: 'Center Panel',
        statusPanel: 'AdaptableStatusPanel',
        align: 'center',
      },
    ],
  },
  tooltipShowDelay: 500,
};
```

#### Special Column Properties

AdapTable provides a large set of property options for [Calculated](https://www.adaptabletools.com/docs/handbook-calculated-column/index.md) and [FreeText](https://www.adaptabletools.com/docs/handbook-freetext-column/index.md) Columns (e.g. `Filterable`, `Groupable` etc.)

But sometimes developers will want to add additional properties.

This is achieved by supplying the Column Types in AG Grid Column Definitions, which they (and end users) can then attach to the Special Column.

This is particularly useful when you have defined bespoke AG Grid Column Types and you want to extend them to columns created at run-time in AdapTable.

The list of additional column type options to show to the run-time user is also defined (like with Scope - see above) in the `columnTypes` property in [Column Options](https://www.adaptabletools.com/docs/technical-reference-column/index.md).

### Pivot Total Columns

Another use case for using Column Types in AdapTable is when formatting [Pivot Total Columns](https://www.adaptabletools.com/docs/handbook-layouts-pivot-total-columns/index.md).

AdapTable provides 3 types of Pivot Total Columns each of which is given its own `type` property value:

| Pivot Total Column      | Value for `type` property | AdaptableColumnType Value |
| ----------------------- | ------------------------- | ------------------------- |
| Pivot Grand Total       | `pivotGrandTotal`         | ּּ`PivotGrandTotal`       |
| Pivot Column Total      | `pivotColumnTotal`        | ּּ`PivotColumnTotal`      |
| Pivot Aggregation Total | `pivotAggregationTotal`   | ּּ`PivotAggregationTotal` |

- There is also a `PivotAnyTotal` column type available (string value is `pivotAnyTotal`)
- This can be used to display **all** of the 3 Total Column types, particularly useful when formatting and styling

See [Creating Pivot Total Columns](https://www.adaptabletools.com/docs/handbook-layouts-pivot-total-columns/index.md) for more information

### Hidden Columns

A further use case for using Column Types in AdapTable is when [hiding a Column altogether](https://www.adaptabletools.com/docs/dev-guide-columns-hiding-columns/index.md).

This can be done by setting the column type to `hiddenColumn`.

Columns marked with this type will not be:

- rendered in the Grid
- available in the Layout Wizard Editor
- listed in the Columns Tool Panel

However they will be available in the [Expression Editor](https://www.adaptabletools.com/docs/ui-expression-editor/index.md) and [Query Builder](https://www.adaptabletools.com/docs/ui-query-builder/index.md) in order to use it to create Expressions.

See [Hiding Columns in AdapTable](https://www.adaptabletools.com/docs/dev-guide-columns-hiding-columns/index.md) for more details and a demo

### FDC3 Columns

[FDC3](https://www.adaptabletools.com/docs/handbook-fdc3/index.md) columns use the `fdc3Column` type (`AdaptableColumnType.Fdc3Column`).

See [FDC3 Data Mappings](https://www.adaptabletools.com/docs/handbook-fdc3-mappings/index.md) for how those columns are wired to FDC3 types
