# AG Grid Modules

Canonical page: https://www.adaptabletools.com/docs/getting-started-aggrid-modules

- AG Grid provides functionality via Modules
- These are available either as a Bundle, or individually selected
- Some AG Grid Modules are mandatory in AdapTable, while others are required for certain features to work

AG Grid provides its functionality through a series of [AG Grid Modules](https://ag-grid.com/javascript-data-grid/modules/).

This is available in 2 forms:

- as a bundle (`AllEnterpriseModule`)
- as specific modules (in order to reduce download size)

AG Grid modules must be registered regardless whether you use [ESM (standard) or CommonJS](https://www.adaptabletools.com/docs/getting-started-installation/index.md#esm-and-cjs-formats) formats

## AllEnterpriseModule Bundle

AG Grid provides a comprehensive `AllEnterpriseModule` bundle.

This is the easiest option as it contains both Community and Enterprise modules, including everything AdapTable needs for core functionality.

- Charts and Sparklines are **not** included in the bundle (nor is `ValidationModule` — see [Development Validations](#development-validations))
- Register `AllEnterpriseModule.with(AgChartsEnterpriseModule)` (from `ag-charts-enterprise`) if you use AG Grid Charts or [Sparkline Styled Columns](https://www.adaptabletools.com/docs/handbook-styled-column-sparkline/index.md)

## Selecting Modules

Alternatively, you can register only the modules you want to use in your application.

This allows you to reduce the bundle size of your application (but requires more considered thought).

AG Grid provides a useful [Module Selector](https://www.ag-grid.com/javascript-data-grid/modules/#selecting-modules) to see what is required for your use case from an AG Grid perspective

AdapTable leverages [AG Grid Modules](https://ag-grid.com/javascript-data-grid/modules/) for much of its functionality - both core and feature-specific.

As a result, it is useful to divide the AG Grid Modules into 3 groups:

| Group           | Description                                                                          |
| --------------- | ------------------------------------------------------------------------------------ |
| **Mandatory**   | Without these AG Grid Modules, AdapTable simply won't work, so they must be supplied |
| **Per-Feature** | AG Grid Modules which are needed on a per-feature basis                              |
| **Avoid**       | Using these AG Grid Modules can cause issues, so should be avoided                   |

### Mandatory Modules

There are some Modules which **must be registered** for AdapTable to work.

Without these modules, AdapTable will either not start or will display significant errors at start-up

You must provide the relevant Module, and associated API, for the AG Grid RowModel you are using.

#### Client-Side Row Model

For the (default) Client Side Row Model you need to provide:

- `ClientSideRowModelApiModule`

The Client-Side Row Model is part of the grid core, so `ClientSideRowModelModule` is not required.

#### Server-Side Row Model

If you are using the [Server-Side Row Model](https://www.adaptabletools.com/docs/dev-guide-row-models-server-overview/index.md), you need to provide

- `ServerSideRowModelModule`
- `ServerSideRowModelApiModule`

#### Viewport Row Model

If you are using AG Grid's Viewport Row Model, you need to provide:

- `ViewportRowModelModule`

#### Infinite Row Model

AdapTable does **not** support AG Grid's Infinite Row Model

Additionally there are a number of AG Grid API Modules that AdapTable uses to tie everything together:

#### All Row Models

There are some Modules that need to be provided irrespective of the Row Model being used.

All of these are **mandatory** and must be provided for a seamless and error-free user experience

- `CellStyleModule`
- `ColumnMenuModule`
- `ContextMenuModule`
- `CustomFilterModule`
- `ExternalFilterModule`
- `GridStateModule`
- `GroupFilterModule`
- `RowGroupingModule`
- `RowStyleModule`
- `CellApiModule`
- `ColumnApiModule`
- `EventApiModule`
- `RenderApiModule`
- `RowApiModule`
- `ScrollApiModule`

### Per-Feature Modules

Additional AG Grid Modules must be registered to enable using their specific features in AdapTable.

Without these modules, certain functionalities in AdapTable will be limited or unavailable

Here is the full list of AG Grid Modules which AdapTable requires (on a per-feature basis):

| AG Grid Module           | Where Used                                                                                                                                                                                                      |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `CellSelectionModule`    | [Cell Summary](https://www.adaptabletools.com/docs/handbook-summarising-cells/index.md), [Plus Minus](https://www.adaptabletools.com/docs/handbook-editing-plus-minus/index.md) and [Selecting Data](https://www.adaptabletools.com/docs/handbook-selecting/index.md) |
| `ColumnAutoSizeModule`   | [Layout Auto-Sizing](https://www.adaptabletools.com/docs/handbook-layouts-table-column-sizing/index.md#auto-sizing-in-layout)                                                                                                     |
| `CsvExportModule`        | [CSV Export Report Format](https://www.adaptabletools.com/docs/handbook-exporting-reports-format-type-csv/index.md)                                                                                                               |
| `ExcelExportModule`      | [Excel and VisualExcel Report Formats](https://www.adaptabletools.com/docs/handbook-exporting-reports-format-type-excel/index.md)                                                                                                 |
| `FindModule`             | [Quick Search](https://www.adaptabletools.com/docs/handbook-quick-search/index.md)                                                                                                                                                |
| `NotesModule`            | [Notes](https://www.adaptabletools.com/docs/handbook-notes/index.md)                                                                                                                                                              |
| `IntegratedChartsModule` | If using AG Grid's [Charts](https://www.adaptabletools.com/docs/handbook-charts/index.md) functionality                                                                                                                           |
| `MasterDetailModule`     | By the [Master Detail](https://www.adaptabletools.com/docs/handbook-master-detail/index.md) Plugin                                                                                                                                |
| `PinnedRowModule`        | [Row Summaries](https://www.adaptabletools.com/docs/handbook-summarising-rows/index.md)                                                                                                                                           |
| `PivotModule`            | [Pivoting](https://www.adaptabletools.com/docs/handbook-layouts-pivot/index.md)                                                                                                                                                   |
| `QuickFilterModule`      | Running [Quick Search as Filter](https://www.adaptabletools.com/docs/handbook-quick-search-as-filter/index.md)                                                                                                                    |
| `RichSelectModule`       | If using [Select Editors](https://www.adaptabletools.com/docs/handbook-cell-editors-select/index.md)                                                                                                                              |
| `RowSelectionModule`     | Needed for [Selecting](https://www.adaptabletools.com/docs/handbook-selecting/index.md) via Grid Api                                                                                                                              |
| `SideBarModule`          | [Adaptable ToolPanel](https://www.adaptabletools.com/docs/ui-tool-panel/index.md)                                                                                                                                                 |
| `SparklinesModule`       | [Sparkline Styled Column](https://www.adaptabletools.com/docs/handbook-styled-column-sparkline/index.md)                                                                                                                          |
| `StatusBarModule`        | [Adaptable Status Bar](https://www.adaptabletools.com/docs/ui-status-bar/index.md)                                                                                                                                                |
| `TextEditorModule`       | Used for [editing](https://www.adaptabletools.com/docs/handbook-editing/index.md) (all columns)                                                                                                                                   |
| `TooltipModule`          | [Calculated Column](https://www.adaptabletools.com/docs/handbook-calculated-column/index.md) & many [Styled Columns](https://www.adaptabletools.com/docs/handbook-styled-column-overview/index.md)                                                  |
| `TreeDataModule`         | If using the [Tree Grid](https://www.adaptabletools.com/docs/handbook-tree-data-grid/index.md)                                                                                                                                    |

`IntegratedChartsModule` and `SparklinesModule` also require `AgChartsEnterpriseModule` from `ag-charts-enterprise` (the same module passed to `AllEnterpriseModule.with(...)`)

### To Be Avoided Modules

Two AG Grid Modules should **not** be registered with AdapTable.

#### SetFilterModule

AG Grid provides a `SetFilterModule` - which it uses in its filtering.

However AdapTable provides its filtering independently.

Registering this module can cause AG Grid to treat Set Filter as the default filter type, overriding AdapTable's filter implementation.

We strongly recommend **not importing or registering** the `SetFilterModule`

- When AdapTable filtering is enabled (the default), AdapTable already sets `suppressSetFilterByDefault` to _true_
- If you must register `SetFilterModule`, keep that Grid Option set to _true_

#### CalculatedColumnsModule

AG Grid also provides a `CalculatedColumnsModule`.

That is **not** the same as [AdapTable Calculated Columns](https://www.adaptabletools.com/docs/handbook-calculated-column/index.md) (which are evaluated by [AdapTableQL](https://www.adaptabletools.com/docs/adaptable-ql-expression/index.md) and stored in Adaptable State).

- Do **not** register `CalculatedColumnsModule` if you are using AdapTable Calculated Columns
- Importing both gives users two ways to create calculated columns and is likely to cause confusion

## Development Validations

AG Grid's `ValidationModule` is **not** included in `AllEnterpriseModule`.

It is useful in development - provides fuller console messages and on-grid overlay of configuration problems.

However it should not be shipped in production.

- Register `ValidationModule` in development only
- Alternatively call `enableDevValidations()` from `ag-grid-community` before the grid is created

## Appendix: All AG Grid Modules

This is the full list of AG Grid Modules (listed in the same order as [AG Grid does](https://www.ag-grid.com/javascript-data-grid/modules/#selecting-modules)).

We indicate whether it is required, or used by AdapTable, and if so, where:

| AG Grid Module                                 | Purpose                    | AdapTable Behaviour                            |
| ---------------------------------------------- | -------------------------- | ---------------------------------------------- |
| `ValidationModule`                             | Validation (Dev Mode)      | Recommended in development only                |
| `ColumnAutoSizeModule`                         | Column Auto-Sizing         | Auto Sizing Layouts                            |
| `ColumnHoverModule`                            | Column Hovering            | n/a                                            |
| `AutoGenerateColumnsModule`                    | Auto-Generate Columns      | n/a                                            |
| `FileInputOverlayModule`                       | File Input Overlay         | n/a                                            |
| `CalculatedColumnsModule`                      | AG Grid Calculated Columns | Not AdapTable's feature — **don't provide**    |
| `ColumnHeaderEditModule`                       | Editable Header Name       | Not used — Layouts provide Column Headers      |
| `PinnedRowModule`                              | Pinning Rows               | Row Summaries                                  |
| `RowAutoHeightModule`                          | Auto Row Height            | n/a                                            |
| `RowStyleModule`                               | Styling Rows               | **Mandatory**                                  |
| `PaginationModule`                             | Row Pagination             | n/a                                            |
| `PaginationPageNumbersModule` | Page Number Navigation     | n/a                                            |
| `RowDragModule`                                | Row Dragging               | n/a                                            |
| `RowNumbersModule`                             | Numbering Rows             | n/a                                            |
| `CellSpanModule`                               | Spanning Cells             | n/a                                            |
| `CellStyleModule`                              | Styling Cells              | **Mandatory**                                  |
| `HighlightChangesModule`                       | Highlighting Changes       | n/a                                            |
| `TooltipModule`                                | Tooltips                   | In Calculated Columns & Styled Columns         |
| `FormulaModule`                                | Formulas                   | n/a                                            |
| `FindModule`                                   | Find                       | Quick Search                                   |
| `NotesModule`                                  | Cell Notes                 | Notes                                          |
| `TextFilterModule`                             | Text Filter                | Ignored by AdapTable                           |
| `NumberFilterModule`                           | Number Filter              | Ignored by AdapTable                           |
| `DateFilterModule`                             | Date Filter                | Ignored by AdapTable                           |
| `BigIntFilterModule`                           | BigInt Filter              | Ignored by AdapTable                           |
| `SetFilterModule`                              | Set Filter                 | Can break AdapTable - **do not provide**       |
| `MultiFilterModule`                            | Multi Filter               | Ignored by AdapTable                           |
| `CustomFilterModule`                           | Custom Filter              | **Mandatory**                                  |
| `AdvancedFilterModule`                         | Advanced Filter            | Ignored by AdapTable                           |
| `ExternalFilterModule`                         | External Filter            | **Mandatory**                                  |
| `QuickFilterModule`                            | Quick Filter               | Quick Search (Filter Results)                  |
| `RowSelectionModule`                           | Row Selection              | Needed for Row Select Api methods              |
| `CellSelectionModule`                          | Cell Selection             | Needed for Cell Select Api methods             |
| `TextEditorModule`                             | Text Editor                | Used for editing (all columns)                 |
| `LargeTextEditorModule`                        | Large Text Editor          | n/a                                            |
| `SelectEditorModule`                           | Select Editor              | n/a                                            |
| `RichSelectModule`                             | Rich Select Editor         | Used for Adaptable Select Cell Edits           |
| `NumberEditorModule`                           | Number Editor              | n/a                                            |
| `DateEditorModule`                             | Date Editor                | n/a                                            |
| `CheckboxEditorModule`                         | Checkbox Editor            | n/a                                            |
| `CustomEditorModule`                           | Custom Cell Editor         | n/a                                            |
| `UndoRedoEditModule`                           | Undo / Redo Edits          | n/a                                            |
| `BatchEditModule`                              | Batch Edit                 | n/a                                            |
| `LocaleModule`                                 | Localisation               | n/a                                            |
| `RowGroupingModule`                            | Row Grouping               | **Mandatory**                                  |
| `RowGroupingPanelModule`                       | Row Grouping Panel         | n/a                                            |
| `GroupFilterModule`                            | Group Filter               | **Mandatory**                                  |
| `RowGroupingEditModule`                        | Editing Group Row Cells    | n/a                                            |
| `PivotModule`                                  | Pivoting                   | Pivot Layouts                                  |
| `TreeDataModule`                               | Tree Data                  | Tree Grids                                     |
| `ShowValuesAsModule`                           | Show Values As             | n/a                                            |
| `MasterDetailModule`                           | Master Detail              | Master Detail plugin                           |
| `SideBarModule`                                | Side Bar                   | AdapTable Tool Panel                           |
| `ColumnsToolPanelModule`                       | Columns Tool Panel         | n/a                                            |
| `FiltersToolPanelModule`                       | Filters Tool Panel         | n/a                                            |
| `NewFiltersToolPanelModule`                    | New Filters Tool Panel     | n/a                                            |
| `ColumnMenuModule`                             | Column Menu                | **Mandatory**                                  |
| `ContextMenuModule`                            | Context Menu               | **Mandatory**                                  |
| `StatusBarModule`                              | Status Bar                 | AdapTable Status Panels                        |
| `ToolbarModule`                                | Toolbar                    | n/a                                            |
| `AiToolkitModule`                              | AI Toolkit                 | n/a                                            |
| `CsvExportModule`                              | CSV Export                 | CSV Export Report Format                       |
| `ExcelExportModule`                            | Excel Export               | Excel Export Report Format                     |
| `PdfExportModule`                              | PDF Export                 | n/a                                            |
| `ClipboardModule`                              | Clipboard                  | n/a                                            |
| `DragAndDropModule`                            | Drag & Drop                | n/a                                            |
| `ValueCacheModule`                             | Value Cache                | n/a                                            |
| `AlignedGridsModule`                           | Aligned Grids              | n/a                                            |
| `GridStateModule`                              | Grid State                 | **Mandatory**                                  |
| `ColumnApiModule`                              | Column API                 | **Mandatory**                                  |
| `RowApiModule`                                 | Row API                    | **Mandatory**                                  |
| `CellApiModule`                                | Cell API                   | **Mandatory**                                  |
| `ScrollApiModule`                              | Scrolling API              | **Mandatory**                                  |
| `RenderApiModule`                              | Rendering API              | **Mandatory**                                  |
| `EventApiModule`                               | Event API                  | **Mandatory**                                  |
| `ClientSideRowModelApiModule`                  | Client-Side Row Model API  | **Mandatory** (if using Client-Side Row Model) |
| `ServerSideRowModelApiModule`                  | Server-Side Row Model API  | **Mandatory** (if using Server-Side Row Model) |

The Module Selector does not list Charts, Sparklines or Row Model modules. The extra ones AdapTable uses are:

| AG Grid Module                              | Purpose               | AdapTable Behaviour                                            |
| ------------------------------------------- | --------------------- | -------------------------------------------------------------- |
| `IntegratedChartsModule`                    | Integrated Charts     | AG Grid Charts (requires `AgChartsEnterpriseModule`)           |
| `SparklinesModule`                          | Sparklines            | Sparkline Styled Columns (requires `AgChartsEnterpriseModule`) |
| `ServerSideRowModelModule` | Server-Side Row Model | **Mandatory** if using Server-Side Row Model                   |
| `ViewportRowModelModule`                    | Viewport Row Model    | **Mandatory** if using Viewport Row Model                      |
| `ClientSideRowModelModule`                  | Client-Side Row Model | Not required (part of grid core)                               |
