Overview
Item colors in RISKSHEET are applied through row header renderers that conditionally style entire rows based on field values. This feature is commonly used to highlight high-risk items, differentiate between work item types, or visually indicate workflow status.Configuration Steps
1. Define Color Schemes in Styles Section
Add CSS class definitions to thestyles section of your risksheet.json:
2. Create a Cell Decorator Function
Define a JavaScript function in thecellDecorators section that applies CSS classes based on field values:
info.item['fieldName']- Access work item field values$(info.cell).toggleClass('className', condition)- Apply CSS class when condition is true- Multiple
toggleClasscalls support multi-condition logic
3. Apply Renderer to Row Header
Reference your decorator in theheaders.rowHeader.renderer configuration property:
Complete Example: RPN-Based Risk Coloring
| RPN Value | Decorator Logic | CSS Class | Color |
|---|---|---|---|
| 0-150 | rpn1 condition | .rpn1 | Green |
| 151-350 | rpn2 condition | .rpn2 | Yellow |
| 351+ | rpn3 condition | .rpn3 | Red |
Alternative: Enum-Based Coloring
For status or category-based coloring, compare field values to enum IDs (not display labels):Verification
After saving your configuration:- Open your RISKSHEET widget
- Row headers should display background colors corresponding to their field values
- Verify colors update automatically when field values change (e.g., when RPN recalculates after editing severity/occurrence)
See Also
- Configure Row Header Styles - More row header customization options
- Apply Conditional Formatting - Style individual cells based on values
- Configure Cell Styles - Apply conditional styling to data cells
- Cell Decorators - Complete decorator API reference
- CSS Classes - Available CSS class reference
Sources
Sources
KB ArticlesSource Code
risksheet.jsonAppConfig.tsCellEditorFormatter.tsExportToPdf.tsRiskSheetContextMenu.ts