How Conditional Formatting Works
The conditional formatting pipeline flows through three stages: a formula calculates the cell value, a cell decorator evaluates that value and toggles CSS classes, and the style definitions apply visual properties to those classes.Configuration Components
Cell Decorators Reference
cellDecorators Property
Decorator Function Signature
Each cell decorator function receives a singleinfo parameter object:
Built-In Decorator: rpn
Applies conditional CSS classes to Risk Priority Number (RPN) cells based on risk thresholds:
The RPN thresholds shown here (150/250) are typical defaults but are user-configurable in the cell decorator function. Different deployments use different thresholds depending on their risk scoring scale and methodology. Adjust the numeric boundaries in the decorator to match your organization’s risk tolerance.
Built-In Decorator: rowHeaderRpnNew
Applies conditional CSS classes to row headers based on the revised RPN value (after mitigations):
Row header decorators read from
info.item (the full item data), not info.value, because the row header does not have a bound column value. The decorator name must match the headers.rowHeader.renderer value. Row header decorators use jQuery $(info.cell).toggleClass('className', condition) — the same syntax as cell decorators, and what the shipped configurations use. The Wijmo form wijmo.toggleClass(info.cell, 'className', condition) is also supported as an alternative.Styles Reference
styles Property
Style Definition Format
Style keys use CSS selector syntax with a leading dot. The value contains CSS properties wrapped in curly braces{}.
Default RPN Style Definitions
Header Group Styles
Styles can target header group rows using compound selectors:Formulas Reference
formulas Property
Formula Function Signature
Built-In Formula: commonRpn
Calculates the initial RPN by multiplying occurrence, detection, and severity:
Built-In Formula: commonRpnNew
Calculates the revised RPN (after mitigations) using the new rating values:
Enum Value Formatting
When applying conditional formatting to enum columns, cell decorator functions must compare against enum IDs, not display values.Enum values are not declared inside the sheet configuration. Enumerations are defined centrally in Siemens Polarion ALM (Administration > Enumerations) and referenced by column definitions via
type: enum:<enumId> or type: multiEnum:<enumId>. The Risksheet server loads enum values automatically when rendering the grid.approvalStatus enum (with IDs yes / no) is defined in Polarion Administration, not in the sheet configuration. The decorator function reads info.value and toggles CSS classes that the styles section visualizes.
Row Header Formatting
Apply conditional formatting to row headers based on item data. The row header renderer reads from the full item data object rather than a specific column value.Severity-Based Cell Styling
Apply color gradients based on individual severity ratings (not the combined RPN):Conditional Editability
Use cell decorators to dynamically control which fields are editable based on item state. This pattern modifies thesystemReadOnlyFields value on the item to lock specific columns.
severity and occurrence to the pipe-delimited systemReadOnlyFields string when the item’s reviewStatus enum equals approved, preventing edits to risk parameters on already-reviewed items. The rs-readonly CSS class applies the built-in Risksheet visual styling for grayed-out cells.
Risksheet approval review creates approval-tagged comments but does not trigger Polarion’s formal approval workflow (draft -> reviewed -> approved). When using
reviewStatus-based conditional locking, remember that the field reflects Risksheet’s review state, not Polarion’s formal work item approval status.Column-Level CSS
In addition to cell decorators, you can apply static CSS classes to all cells in a column using thecellCss property:
Complete Example
Full FMEA conditional formatting configuration with initial and revised risk color coding, row header formatting, and rating-based styling:severity, occurrence, detection) referenced by type: "rating:..." are defined in Polarion Administration -> Enumerations, not in the sheet configuration.
Troubleshooting
Related Pages
- Cell Decorators — cell decorator function reference and patterns
- CSS Classes — complete CSS class reference and custom style definitions
- Item Colors — row-level color coding for work item types
- Formula Syntax — formula function syntax and
infoobject reference - Formula Examples — formula patterns that drive conditional formatting
- Custom Renderer Templates — advanced cell rendering with JavaScript functions