GridOptions interface is the primary configuration object for AG Grid. It contains all the properties that control the grid’s behavior, appearance, and functionality.
Overview
GridOptions can be provided when creating the grid:Core Properties
Row Data
Data to be displayed in the grid as rows. Each item in the array represents a row.
Column Definitions
A default column definition. Items defined in the actual column definitions get precedence.
A default column group definition. All column group definitions will use these properties. Items defined in the actual column group definition get precedence.Initial: This property cannot be updated after the grid is created.
Pagination
Set whether pagination is enabled.Module:
PaginationModuleHow many rows to load per page. If
paginationAutoPageSize is specified, this property is ignored.Module: PaginationModuleDetermines if the page size selector is shown in the pagination panel or not. Set to an array of values to show the page size selector with custom list of possible page sizes. Set to
true to show the page size selector with the default page sizes [20, 50, 100]. Set to false to hide the page size selector.Module: PaginationModule
Initial: This property cannot be updated after the grid is created.Set to
true so that the number of rows to load per page is automatically adjusted by the grid so each page shows enough rows to just fill the area designated for the grid. If false, paginationPageSize is used.Module: PaginationModuleRow Selection
Configure row selection behavior. Replaces the deprecated individual selection properties.Module:
RowSelectionModuleSorting
Array defining the order in which sorting occurs (if sorting is enabled). Values can be
'asc', 'desc' or null. For example: sortingOrder: ['asc', 'desc'].Set to
'shift' to use the Shift key for multi-sorting instead of Ctrl.Editing
Set to
'fullRow' to enable Full Row Editing. Otherwise leave blank to edit one cell at a time.Module: TextEditorModule / LargeTextEditorModule / NumberEditorModule / DateEditorModule / CheckboxEditorModule / CustomEditorModule / SelectEditorModule / RichSelectModuleSet to
true to enable Single Click Editing for cells, to start editing with a single click.Module: TextEditorModule / LargeTextEditorModule / NumberEditorModule / DateEditorModule / CheckboxEditorModule / CustomEditorModule / SelectEditorModule / RichSelectModuleSet this to
true to stop cell editing when grid loses focus. The default is that the grid stays editing until focus goes onto another cell.Module: TextEditorModule / LargeTextEditorModule / NumberEditorModule / DateEditorModule / CheckboxEditorModule / CustomEditorModule / SelectEditorModule / RichSelectModule
Initial: This property cannot be updated after the grid is created.Set to
true to enable Undo / Redo while editing.Module: UndoRedoEditModule
Initial: This property cannot be updated after the grid is created.Filtering
Rows are filtered using this text as a Quick Filter. Only supported for Client-Side Row Model.Module:
QuickFilterModuleSet to true to enable the Advanced Filter.Module:
AdvancedFilterModuleRow Grouping & Aggregation
If grouping, set to the number of levels to expand by default, e.g.
0 for none, 1 for first level only, etc. Set to -1 to expand everything.Module: RowGroupingModuleA map of ‘function name’ to ‘function’ for custom aggregation functions.Module:
RowGroupingModule / PivotModule / TreeDataModule / ServerSideRowModelModule
Initial: This property cannot be updated after the grid is created.Styling & Theming
The theme to use for the grid. Can be a built-in theme name or a custom theme object.
The height in pixels for each row. If not specified, it uses the theme value.
The height in pixels for the row containing the column label header. If not specified, it uses the theme value of
header-height.Set to
false to disable Row Animation which is enabled by default.Performance
The number of rows rendered outside the viewable area the grid renders. Having a buffer means the grid will have rows ready to show as the user slowly scrolls vertically.
Set to
true so that the grid doesn’t virtualise the columns. For example, if you have 100 columns, but only 10 visible due to scrolling, all 100 will always be rendered. It is not recommended to set this to true as it may cause performance issues.Initial: This property cannot be updated after the grid is created.Set to
true so that the grid doesn’t virtualise the rows. For example, if you have 100 rows, but only 10 visible due to scrolling, all 100 will always be rendered. It is not recommended to set this to true as it may cause performance issues.Initial: This property cannot be updated after the grid is created.Callbacks
Called once when the grid is ready to use. Use this to access the Grid API.
Called when a row is clicked.
Called when a cell value is changed.
Context
Provides a context object that is provided to different callbacks the grid uses. Used for passing additional information to the callbacks used by your application.Initial: This property cannot be updated after the grid is created.
Related APIs
GridApi
Interact with the grid programmatically
Column Definitions
Configure individual columns
Grid Events
Listen to grid lifecycle events