To access the api see: Grid Api.
Accessories
show | Show the column chooser. See: Column Menu API |
show | Show the filter for the provided column. See: Column Menu API |
show | Show the column menu for the provided column. See: Column Menu API |
show | Displays the AG Grid context menu |
hide | Hides any visible context menu or column menu. |
hide | Hide the column chooser if visible. See: Column Menu API |
get | Returns the current side bar configuration. If a shortcut was used, returns the detailed long form. See: Side Bar API |
set | Show/hide the entire side bar, including any visible panel and the tab buttons. See: Side Bar |
is | Returns true if the side bar is visible.See: Side Bar |
set | Sets the side bar position relative to the grid. Possible values are 'left' or 'right' .See: Side Bar |
open | Opens a particular tool panel. Provide the ID of the tool panel to open. See: Tool Panel |
close | Closes the currently open tool panel (if any). See: Tool Panel |
get | Returns the ID of the currently shown tool panel if any, otherwise null .See: Tool Panel |
is | Returns true if the tool panel is showing, otherwise false .See: Tool Panel |
refresh | Force refresh all tool panels by calling their refresh method.See: Tool Panel |
get | Gets the tool panel instance corresponding to the supplied id . |
get | Gets the status panel instance corresponding to the supplied id . |
Clipboard
See Clipboard for more information.
cut | Cuts data to clipboard by following the same rules as pressing Ctrl+X. |
copy | Copies data to clipboard by following the same rules as pressing Ctrl+C. |
copy | Copies the selected ranges to the clipboard. See: Copying via the API |
copy | Copies the selected range down, similar to ^ Ctrl+D in Excel. |
copy | Copies the selected rows to the clipboard. See: Copying via the API |
paste | Pastes the data from the Clipboard into the focused cell of the grid. If no grid cell is focused, calling this method has no effect. |
Column Definitions
See Updating Column Definitions for more information.
Column Display
Column Groups
See Column Groups
get | Returns the column group with the given name. See: Column Groups |
get | Returns the provided column group with the given name. |
set | Call this if you want to open or close a column group. |
Column Moving
See Column Moving
Column Pinning
See Column Pinning
Column Sizing
See Column Sizing
Column State
See Column State
get | Gets the state of the columns. Typically used when saving column state. See: Save and Apply State |
apply | Applies the state of the columns from a previous state. Returns false if one or more columns could not be found.See: Save and Apply State |
reset | Sets the state back to match the originally provided column definitions. |
get | Gets the state of the column groups. Typically used when saving column group state. See: Column Group State |
set | Sets the state of the column group state from a previous state. See: Column Group State |
reset | Sets the state back to match the originally provided column definitions. |
Editing
See Cell Editing for more information.
start | Start editing the provided cell. If another cell is editing, the editing will be stopped in that other cell. See: Editing API |
stop | If a cell is editing, it stops the editing. Pass true if you want to cancel the editing (i.e. don't accept changes).See: Editing API |
get | If the grid is editing, returns back details of the editing cell(s). See: Editing API |
get | Returns the list of active cell editor instances. Optionally provide parameters to restrict to certain columns / row nodes. |
Events
add | Add an event listener for the specified eventType .
Listener will receive the event as a single parameter.
Listeners will be automatically removed when the grid is destroyed. |
remove | Remove an event listener. |
add | Add an event listener for all event types coming from the grid.
Listener will receive eventType and event as parameters.
Listeners will be automatically removed when the grid is destroyed.
If handling multiple event types it is recommended to use event.type to enable TypeScript to infer the event parameters. |
remove | Remove a global event listener. |
add | Registers a callback to a virtual row.
A virtual row is a row that is visually rendered on the screen (rows that are not visible because of the scroll position are not rendered).
Unlike normal events, you do not need to unregister rendered row listeners.
When the rendered row is removed from the grid, all associated rendered row listeners will also be removed.
listen for this event if your cellRenderer needs to do cleanup when the row no longer exists.See: Row Events |
Export
See Export for more information.
export | Downloads a CSV export of the grid's data. See: CSV Export |
get | Similar to exportDataAsCsv , except returns the result as a string rather than download it.See: CSV Export |
export | Downloads an Excel export of the grid's data. |
get | Similar to exportDataAsExcel , except instead of downloading a file, it will return a Blob to be processed by the user. |
get | This is method to be used to get the grid's data as a sheet, that will later be exported either by getMultipleSheetsAsExcel() or exportMultipleSheetsAsExcel() . |
export | Downloads an Excel export of multiple sheets in one file. |
get | Similar to exportMultipleSheetsAsExcel , except instead of downloading a file, it will return a Blob to be processed by the user. |
Filtering
See Filtering for more information.
get | Get the current Quick Filter text from the grid, or undefined if none is set. |
reset | Reset the Quick Filter cache text on every rowNode. See: Reset Cache Text |
is | Returns true if the Quick Filter is set, otherwise false . |
is | Returns true if any column filter is set, otherwise false . |
is | Returns true if any filter is set. This includes quick filter, column filter, external filter or advanced filter. |
get | Returns the filter component instance for a column.
For getting/setting models for individual column filters, use getColumnFilterModel and setColumnFilterModel instead of this.
key can be a column ID or a Column object. |
get | Gets the current state of all the column filters. Used for saving filter state. |
set | Sets the state of all the column filters. Provide it with what you get from getFilterModel() to restore filter state.
If inferring cell data types, and row data is provided asynchronously and is yet to be set,
the filter model will be applied asynchronously after row data is added.
To always perform this synchronously, set cellDataType = false on the default column definition,
or provide cell data types for every column. |
get | Gets the current filter model for the specified column.
Will return null if no active filter. |
set | Sets the filter model for the specified column.
Setting a model of null will reset the filter (make inactive).
Must wait on the response before calling api.onFilterChanged() . |
on | Informs the grid that a filter has changed. This is typically called after a filter change through one of the filter APIs. |
destroy | Destroys a filter. Useful to force a particular filter to be created from scratch again. |
get | Get the state of the Advanced Filter. Used for saving Advanced Filter state See: Advanced Filter |
set | Set the state of the Advanced Filter. Used for restoring Advanced Filter state See: Advanced Filter |
show | Open the Advanced Filter Builder dialog (if enabled). See: Advanced Filter |
hide | Closes the Advanced Filter Builder dialog (if enabled).
Un-applied changes are discarded. See: Advanced Filter |
Grid Options
get | Returns the grid option value for a provided key. See: GridOptions |
set | Updates a single gridOption to the new value provided. (Cannot be used on Initial properties.)
If updating multiple options, it is recommended to instead use api.updateGridOptions() which batches update logic.See: GridOptions |
update | Updates the provided subset of gridOptions with the provided values. (Cannot be used on Initial properties.)See: GridOptions |
Integrated Charts
See Integrated Charts for more information.
create | Used to programmatically create charts from a range. See: Range Chart API |
create | Used to programmatically create pivot charts from a grid. See: Pivot Chart API |
create | Used to programmatically create cross filter charts from a range. See: Cross-filter API |
update | Used to programmatically update a chart. |
get | Returns the ChartRef using the supplied chartId . |
get | Returns a list of models with information about the charts that are currently rendered from the grid. |
restore | Restores a chart using the ChartModel that was previously obtained from getChartModels() . |
get | Returns a base64-encoded image data URL for the referenced chartId. |
download | Starts a browser-based image download for the referenced chartId. |
open | Open the Chart Tool Panel. |
close | Close the Chart Tool Panel. |
Keyboard Navigation
See Keyboard Navigation for more information.
get | Returns the focused cell (or the last focused cell if the grid lost focus). |
set | Sets the focus to the specified cell. rowPinned can be either 'top', 'bottom' or null (for not pinned). |
clear | Clears the focused cell. |
tab | Navigates the grid focus to the next cell, as if tabbing. See: Custom Navigation |
tab | Navigates the grid focus to the previous cell, as if shift-tabbing. See: Custom Navigation |
set | Sets the focus to the specified header. If floatingFilter is true, the Column's floatingFilter element will be focused. |
Master Detail
See Master Detail for more information.
get | Returns the DetailGridInfo corresponding to the supplied detailGridId . |
for | Iterates through each DetailGridInfo in the grid and calls the supplied callback on each. |
add | Register a detail grid with the master grid when it is created. See: Register Detail Grid |
remove | Unregister a detail grid from the master grid when it is destroyed. See: Register Detail Grid |
Miscellaneous
get | Get the current state of the grid. Can be used in conjunction with the initialState grid option to save and restore grid state.See: Grid State |
get | Gets the cell value for the given column and rowNode (row). Will return the cell value or the formatted value depending on the value of params.useFormatter . |
expire | Expire the value cache. See: Value Cache |
destroy | Will destroy the grid and release resources. If you are using a framework you do not need to call this, as the grid links in with the framework lifecycle. However if you are using Web Components or native JavaScript, you do need to call this, to avoid a memory leak in your application. |
is | Returns true if the grid has been destroyed. |
set | Sets an ARIA property in the grid panel (element with role="grid" ), and removes an ARIA property when the value is null.Example: api.setGridAriaProperty('label', 'my grid') will set aria-label="my grid" .api.setGridAriaProperty('label', null) will remove the aria-label attribute from the grid element.See: ARIA Attributes |
get | Returns the gridId for the current grid as specified via the gridOptions property gridId or the auto assigned grid id if none was provided. |
is | Returns true when there are no more animation frames left to process. |
Overlays
See Overlays for more information.
show | Show the no-rows overlay. If suppressNoRowsOverlay is set, or if loading is true, this will not do anything. |
hide | Hide the no-rows overlay if it is showing. |
Pagination
See Row Pagination for more information.
pagination | Returns true when the last page is known; this will always be the case if you are using the Client-Side Row Model for pagination. Returns false when the last page is not known; this only happens when using Infinite Row Model. |
pagination | Returns how many rows are being shown per page. |
pagination | Returns the 0-based index of the page which is showing. |
pagination | Returns the total number of pages. Returns null if paginationIsLastPageFound() === false . |
pagination | The total number of rows. Returns null if paginationIsLastPageFound() === false . |
pagination | Goes to the specified page. If the page requested doesn't exist, it will go to the last page. |
pagination | Navigates to the next page. |
pagination | Navigates to the previous page. |
pagination | Navigates to the first page. |
pagination | Navigates to the last page. |
Pivot and Aggregation
See Pivot and Aggregation for more information
Pivoting
See Pivoting
Refresh
See View Refresh for more information.
refresh | Performs change detection on all cells, refreshing cells where required. See: Refresh Cells |
redraw | Remove row(s) from the DOM and recreate them again from scratch. See: Redraw Rows |
refresh | Redraws the header. Useful if a column name changes, or something else that changes how the column header is displayed. |
flash | Flash rows, columns or individual cells. See: Flashing Cells |
Rendering
get | Retrieve rendered nodes. Due to virtualisation this will contain only the current visible rows and those in the buffer. |
get | Returns the list of active cell renderer instances. |
get | Gets the sizes that various UI elements will be rendered at with the current theme.
If you override the row or header height using gridOptions , the override value you provided will be returned. |
reset | Tells the grid to recalculate the row heights. See: Changing Row Height |
on | Tells the grid a row height has changed. To be used after calling rowNode.setRowHeight(newHeight) .See: Changing Row Height |
Row Displayed
get | Returns the displayed RowNode at the given index .See: Rendering API |
get | Returns the total number of displayed rows. See: Rendering API |
get | Get the index of the first displayed row due to scrolling (includes invisible rendered rows in the buffer). See: Rendering API |
get | Get the index of the last displayed row due to scrolling (includes invisible rendered rows in the buffer). See: Rendering API |
Row Drag and Drop
See Row Dragging for more information.
Row Grouping
See Row Grouping for more information.
Row Nodes
get | Returns the row node with the given ID.
The row node ID is the one you provide from the callback getRowId(params) ,
otherwise the ID is a number (cast as string) auto-generated by the grid when
the row data is set. |
for | Iterates through each node (row) in the grid and calls the callback for each node. This works similar to the forEach method on a JavaScript array. This is called for every node, ignoring any filtering or sorting applied within the grid. If using the Infinite Row Model, then this gets called for each page loaded in the page cache.See: Iterating Rows |
for | Similar to forEachNode , except skips any filtered out data.See: Iterating Rows |
for | Similar to forEachNodeAfterFilter , except the callbacks are called in the order the rows are displayed in the grid.See: Iterating Rows |
for | Similar to forEachNode , except lists all the leaf nodes.
This effectively goes through all the data that you provided to the grid before the grid performed any grouping.
If using tree data, goes through all the nodes for the data you provided, including nodes that have children,
but excluding groups the grid created where gaps were missing in the hierarchy.See: Iterating Rows |
Row Pinning
See Row Pinning for more information.
RowModel: Client-Side
apply | Update row data. Pass a transaction object with lists for add , remove and update .See: Transaction Updates |
apply | Same as applyTransaction except executes asynchronously for efficiency. |
flush | Executes any remaining asynchronous grid transactions, if any are waiting to be executed. |
refresh | Refresh the Client-Side Row Model, executing the grouping, filtering and sorting again.
Optionally provide the step you wish the refresh to apply from. Defaults to everything . |
RowModel: Infinite
See Infinite Row Model for more information.
RowModel: Server-Side
See Server-Side Row Model for more information.
set | Sets the rowCount and maxRowFound properties.
The second parameter, maxRowFound , is optional and if left out, only rowCount is set.
Set rowCount to adjust the height of the vertical scroll.
Set maxRowFound to enable / disable searching for more rows.
Use this method if you add or remove rows into the dataset and need to reset the number of rows or instruct the grid that the entire row count is no longer known. |
refresh | Refresh a server-side store level.
If you pass no parameters, then the top level store is refreshed.
To refresh a child level, pass in the string of keys to get to the desired level.
Once the store refresh is complete, the storeRefreshed event is fired. See: Purging Groups |
get | Returns info on all server side group levels. |
retry | Gets all failed server side loads to retry. See: Retry Loads |
apply | Apply transactions to the server side row model. See: Transactions |
apply | Batch apply transactions to the server side row model. See: Transactions |
apply | Applies row data to a server side store.
New rows will overwrite rows at the same index in the same way as if provided by a datasource success callback. |
get | Returns an object containing rules matching the selected rows in the SSRM.
If groupSelectsChildren=false the returned object will be flat, and will conform to IServerSideSelectionState .
If groupSelectsChildren=true the returned object will be hierarchical, and will conform to IServerSideGroupSelectionState .See: Selection |
set | Set the rules matching the selected rows in the SSRM.
If groupSelectsChildren=false the param will be flat, and should conform to IServerSideSelectionState .
If groupSelectsChildren=true the param will be hierarchical, and should conform to IServerSideGroupSelectionState .See: Selection |
get | Returns an object representing the state of the cache. This is useful for debugging and understanding how the cache is working. See: Cache Block State |
Scrolling
Selection
See Selection Overview for more information.
select | Select all rows, regardless of filtering and rows that are not visible due to grouping being enabled and their groups not expanded. |
deselect | Clear all row selections, regardless of filtering. |
select | Select all filtered rows. |
deselect | Clear all filtered selections. |
select | Select all rows on the current page. |
deselect | Clear all filtered on the current page. |
get | Returns an unsorted list of selected nodes.
Getting the underlying node (rather than the data) is useful when working with tree / aggregated data,
as the node can be traversed. |
get | Returns an unsorted list of selected rows (i.e. row data that you provided). |
set | Set all of the provided nodes selection state to the provided value. |
get | Returns a list of all selected nodes at 'best cost', a feature to be used with groups / trees.
If a group has all its children selected, then the group appears in the result, but not the children.
Designed for use with 'children' as the group selection type, where groups don't actually appear in the selection normally. |
get | Returns the list of selected cell ranges. See: getCellRanges |
add | Adds the provided cell range to the selected ranges. See: addCellRange |
clear | Clears the selected ranges. See: clearRangeSelection |
Sorting
See Row Sorting for more information.
on | Gets the grid to act as if the sort was changed.
Useful if you update some values and want to get the grid to reorder them according to the new values. |
Undo / Redo
See Undo/Redo Edits for more information.