This page has limited source coverage. Some behaviors should be verified against the running application.
Renderer Architecture
Custom renderers sit between the data model and the grid display. When Risksheet renders a cell, it first applies built-in rendering for the column type, then invokes any custom renderer registered for that column binding.Configuration Properties
Column-Level Renderer Assignment
Register a custom renderer on a specific column using thecellRenderer property in the column definition. The function name must match a function registered on the global window.risksheet.cellRenderers object (typically defined inside risksheetTopPanel.vm).
Row Header Renderer
The row header (the leftmost fixed column showing row numbers) supports a custom renderer through theheaders configuration.
Renderer Function Signature
Each custom renderer function receives four parameters:
Define renderer functions in the Top Panel Template using a
<script> block, or register them on the global window.risksheet.cellRenderers object from any script loaded into the page.
Built-In Column Type Rendering
Risksheet applies built-in rendering for standard column types before custom renderers execute. Understanding these defaults helps you write renderers that augment rather than conflict with standard behavior.Formula Integration with Renderers
Formulas execute during cell rendering and produce thevalue parameter passed to custom renderers. This means your renderer receives the calculated result, not the raw stored data.
When a formula result differs from the stored value, the system can mark the item as edited. Formula changes respect the
readOnly column setting. The formula mark changes behavior enables tracking of calculated field changes for audit purposes.Read-Only Cell Marking
Cells are visually marked as read-only based on cell-level permissions. Thereadonly CSS class is applied to indicate non-editable cells. Read-only state is determined by checking the following conditions:
Comparison and Baseline Highlighting
When a comparison manager is configured (viewing changes against a previous revision or baseline), Risksheet applies specialized cell highlighting that overrides custom renderers.During baseline comparisons, sorting operates on the baseline snapshot values rather than current values, except for system identity fields (
systemItemId and systemItemRevision) which always refer to the current item.Cell Decorator vs. Cell Renderer
Risksheet provides two mechanisms for customizing cell appearance. Understanding the distinction prevents configuration errors.Complete Example
The following example shows a full custom renderer setup for an FMEA risksheet with severity badge rendering, RPN color coding via row headers, and a custom risk acceptance indicator. Top panel template (risksheetTopPanel.vm):
Related Pages
- Top Panel Template — where to define renderer function implementations
- Cell Decorators — CSS class toggling based on cell values
- Conditional Formatting — style definitions for cell decorator classes
- CSS Classes — available CSS classes and custom style definitions
- Calculated Columns — formula-driven column values that feed into renderers
- Column Type Reference — all column type options and their rendering behavior
- Velocity Templates — Velocity template system overview