ICellRendererComp interface allows you to create custom components for rendering cell content in AG Grid. Cell renderers control how data is displayed in individual cells.
Overview
Create custom cell renderers to display complex content, add interactivity, or format data in ways that go beyond simple text formatting.Interface Definition
ICellRendererParams
Value to be rendered.
Formatted value to be rendered (if a valueFormatter was provided).
The row’s data. Data property can be
undefined when row grouping or loading infinite row models.The row node.
The cell’s column definition.
The cell’s column.
The grid’s cell, a DOM div element.
The parent DOM item for the cell renderer, same as eGridCell unless using checkbox selection.
Utility Methods
Convenience function to get most recent up to data value.
Convenience function to set the value.
Convenience function to format a value using the column’s formatter.
Convenience function to refresh the cell.
registerRowDragger
(rowDraggerElement: HTMLElement, dragStartPixels?: number, value?: string, suppressVisibilityChange?: boolean) => void
Register an element as a row dragger.Parameters:
rowDraggerElement: The HTMLElement to be used as Row DraggerdragStartPixels: The amount of pixels required to start the drag (Default: 4)value: The value to be displayed while draggingsuppressVisibilityChange: Set totrueto prevent the Grid from hiding the Row Dragger when it is disabled
RowDragModuleSets a tooltip to the main element of this component.Parameters:
value: The value to be displayed by the tooltipshouldDisplayTooltip: A function returning a boolean that allows the tooltip to be displayed conditionally
TooltipModuleRequired Methods
Called once when the component is created. Use this to set up your component.
Return the DOM element for your cell renderer.
Get the cell to refresh. Return
true if successful. Return false if not (or you don’t have refresh logic), then the grid will refresh the cell for you.Optional Methods
Optional: Gets called once when the component is being removed. Use this to clean up any resources.
Complete Example
Related APIs
Cell Editor
Create custom cell editors
Column Definitions
Configure cell renderers in columns
GridOptions
Grid-level component configuration