JavaScript Data Grid: Grid Callbacks
All of these grid callbacks are available through the GridOptions interface.
Rows
getBusinessKeyForNodeFunction | 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 rows based on unique business keys. | |
getRowNodeIdFunction | 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. | |
processRowPostCreateFunction | Allows you to process rows after they are created, so you can do final adding of custom attributes etc. | |
isRowSelectableFunction | 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. | |
isRowMasterFunction | 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. |
Rendering and Styling
getRowClassFunction | Callback version of property rowClass. Function should return a string or an array of strings. | |
getRowStyleFunction | Callback version of property rowStyle. Function should return an object of CSS values. | |
getRowHeightFunction | Callback version of property rowHeight. Function should return a positive number of pixels, or return null/undefined to use the default row height. | |
isFullWidthCellFunction | Tells the grid if this row should be rendered as full width. |
Sort and Filter
isExternalFilterPresentFunction | Grid calls this method to know if an external filter is present. See External Filter. | |
doesExternalFilterPassFunction | | |
postSortFunction | Callback to perform additional sorting after the grid has sorted the rows. See Post Sort. |
Row Grouping and Pivoting
groupRowAggNodesFunction | Callback for grouping. See Row Grouping. | |
isGroupOpenByDefaultFunction | (Client-side Row Model only) Allows groups to be open by default. | |
defaultGroupOrderComparatorFunction | Allows default sorting of groups. See Default Group Order. | |
processSecondaryColDefFunction | Callback to be used with pivoting, to allow changing the second column definition. | |
processSecondaryColGroupDefFunction | Callback to be used with pivoting, to allow changing the second column group definition. |
Popup / Menus
getContextMenuItemsFunction | For customising the context menu. See Context Menu. | |
getMainMenuItemsFunction | For customising the main 'column header' menu. See Column Menu. | |
postProcessPopupFunction | Allows user to process popups after they are created. Applications can use this if they want to, for example, reposition the popup. |
Clipboard
See Clipboard
processCellForClipboardFunction | 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. | |
processHeaderForClipboardFunction | Allows you to process header values for the clipboard. | |
processCellFromClipboardFunction | 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. | |
sendToClipboardFunction | 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. | |
processDataFromClipboardFunction | Allows complete control of the paste operation, including cancelling the operation (so nothing happens) or replacing the data with other data. |
Keyboard Navigation
navigateToNextHeaderFunction | Allows overriding the default behaviour for when user hits navigation (arrow) key when a header is focused. | |
tabToNextHeaderFunction | Allows overriding the default behaviour for when user hits Tab key when a header is focused. | |
navigateToNextCellFunction | Allows overriding the default behaviour for when user hits navigation (arrow) key when a cell is focused. | |
tabToNextCellFunction | Allows overriding the default behaviour for when user hits Tab key when a cell is focused. |
Pagination
See Row Pagination
paginationNumberFormatterFunction | 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. |
Row Model: Server-Side
Callbacks for Server-Side Row Model only.
getChildCountFunction | Allows setting the child count for a group row. | |
getServerSideStoreParamsFunction | Allows providing different params for different levels of grouping. | |
isServerSideGroupOpenByDefaultFunction | Allows groups to be open by default. | |
isApplyServerSideTransactionFunction | Allows cancelling transactions. | |
isServerSideGroupFunction | (SSRM Tree Data) Allows specifying which rows are expandable. | |
getServerSideGroupKeyFunction | (SSRM Tree Data) Allows specifying group keys. |
Charts
getChartToolbarItemsFunction | Callback to be used to customise the chart toolbar items. See Configuring Toolbar Items. |
Miscellaneous
getDocumentFunction | 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). |