Prerequisites
Before you begin, locate yourrisksheet.json configuration file. See Find Configuration Files for guidance.
Configuration Steps
1. Define the Cell Decorator Function
Open yourrisksheet.json file and add a function to the cellDecorators section. This JavaScript function applies CSS classes to cells based on their values.
- Reads the cell’s value from
info.value - Applies
rpn1class for values 1-150 (low risk) - Applies
rpn2class for values 151-250 (medium risk) - Applies
rpn3class for values 251+ (high risk)
2. Define CSS Styles
Add style definitions to thestyles section that specify how each CSS class should appear:
3. Apply the Decorator to a Column
In thecolumns array, add the cellRenderer property to the column you want to style:
Working with Enum Fields
When styling based on enumeration values, reference the enum ID, not the display label:Styling Decision Matrix
Common Patterns
Multi-Condition Styling
Style cells based on multiple field values:Text Color and Background
Combine multiple visual properties:Null Value Handling
Apply styles only when values exist:Verification
- Save your
risksheet.jsonconfiguration - Refresh the RISKSHEET widget
- You should now see cells styled according to their values
- Cells should dynamically update styling as values change
Troubleshooting
Styles not applying:- Verify the decorator function name matches the
cellRenderervalue - Confirm the decorator is defined in
cellDecoratorssection - Check that CSS class names match between decorator and
stylessection - Add
!importantflags to CSS properties
- Use enum ID (e.g.,
'yes') not display label (e.g.,'Y') - Check enum definition in Polarion for correct ID values
- Use
wijmo.toggleClass()instead of setting styles directly - Cells are reused during scrolling, so inline styles don’t persist
See Also
- Configure Row Header Styles
- Apply Conditional Formatting
- Cell Decorators Reference
- CSS Classes Reference
- Configuration Properties Index
Sources
Sources
KB Articles
- Configure cell / column styles (colors, fonts, …)
- Configure the style of row header
- Risksheet Document Config File - risksheet.json - format reference
AppConfig.tsrisksheet.jsonExportToExcel.tsAppConfigHelper.tsExportToPdf.ts