Grid Callbacks

All of these grid callbacks are available through the GridOptions interface.

Callbacks

isExternalFilterPresent()Grid calls this method to know if external filter is present.
doesExternalFilterPass(node)Should return true if external filter passes, otherwise false.
getRowClass(params)Callback version of property rowClass. Function should return a string or an array of strings.
getRowStyle(params)Callback version of property rowStyle. Function should return an object of CSS values.
getRowHeight(params)Callback version of property rowHeight. Function should return a positive number, or return null/undefined to use the default row height.
headerCellRenderer(params)Provide a function for custom header rendering.
groupRowAggNodes(nodes)Callback for grouping. See Row Grouping.
getBusinessKeyForNode(node)Return a business key for the node. If implemented, each row in the DOM will have an attribute row-id='abc' where abc is what you return as the business key. This is useful for automated testing, as it provides a way for your tool to identify rules based on unique business keys.
getHeaderCellTemplateFunction to use instead of headerCellTemplate. Should return string or HTML DOM element.
getNodeChildDetails(callback)Allows you to pass tree structure data to the grid, or row data that is already grouped.
getChildCount(data)(For Server-Side Row Model only) Allows setting the child count for a group row.
processRowPostCreate(params)Allows you to process rows after they are created, so you can do final adding of custom attributes etc.
getRowNodeId(data)Allows you to set the ID for a particular row node based on the data. Useful for selection and server side sorting and filtering for paging and virtual pagination.
isFullWidthCell(rowNode)Tells the grid if this row should be rendered using fullWidth
isRowSelectable(rowNode)Callback to be used to determine which rows are selectable. By default rows are selectable, so return false to make a row un-selectable. See Specify Selectable Rows.
isRowMaster(dataItem)Callback to be used with Master Detail to determine if a row should be a master row. If false is returned no detail row will exist for this row.
postSort(rowNodes)Callback to perform additional sorting after the grid has sorted the rows. See Post Sort.
navigateToNextCell(params)Allows overriding the default behaviour for when user hits navigation (arrow) key.
tabToNextCell(params)Allows overriding the default behaviour for when user hits tab key.
getDocument()Allows overriding what document is used. Currently used by Drag and Drop (may extend to other places in the future). Use this when you want the grid to use a different document than the one available on the global scope. This can happen if docking out components (something which Electron supports).
getContextMenuItems(params)For customising the context menu.
getMainMenuItems(params)For customising the main 'column header' menu.
processCellForClipboard(params)Allows you to process cells for the clipboard. Handy if for example you have Date objects that need to have a particular format if importing into Excel.
processCellFromClipboard(params)Allows you to process cells from the clipboard. Handy if for example you have number fields, and want to block non-numbers from getting into the grid.
sendToClipboard(params)Allows you to get the data that would otherwise go to the clipboard. To be used when you want to control the 'copy to clipboard' operation yourself.
processSecondaryColDef(colDef)Callback to be used with pivoting, to allow changing the second column definition.
processSecondaryColGroupDef(colGroupDef)Callback to be used with pivoting, to allow changing the second column group definition.
postProcessPopup(params)Allows user to process popups after they are created. Applications can use this if they want to, for example, reposition the popup.
defaultGroupSortComparator(nodeA, nodeB)Allows default sorting of groups. See Default Group Order.
suppressKeyboardEvent(params)Suppress the grid taking action for the relevant keyboard event. See Suppress Grid Keyboard Events.
processChartOptions(params)Callback to be used to with charts to override default chart options. See Overriding Chart Options.
getChartToolbarItems(params)Callback to be used to customise the chart toolbar items. See Configuring Toolbar Items.
paginationNumberFormatter(params)Allows user to format the numbers in the pagination panel, i.e. 'row count' and 'page number' labels. This is for pagination panel only, to format numbers inside the grid's cells (i.e. your data), then use valueFormatter in the column definitions.