Skip to main content
Advanced topicJavaScript display functions are an advanced customization technique. Before using them, ensure you are comfortable with adding columns and configuring formatters.

Understand render vs display vs renderers

Powersheet offers three properties for controlling cell output. Each serves a distinct purpose:
render and display are display-onlyNeither render nor display modify the underlying data — but neither can supply content of its own either. They restyle whatever the cell already holds.If you need a computed value, use the value property on the column instead:
  • bind the column to a real property to have the computed result saved back to the data source, or
  • prefix the binding key with $ to make the column unbound, so the value is computed and shown but never stored.
See Add a Computed Column.
diagram

Use display for property selection

The simplest use of display is selecting which property of a linked entity to show. For scalar navigation properties (n-to-1 relationships), set it to a property name string:
This shows the title property of the linked Hazard entity instead of the default identifier.

Use display with a JavaScript function

For dynamic cell content, set display to a JavaScript arrow function string. The function receives a context object and should return an HTML string:
Use the YAML > (folded scalar) indicator for multi-line function strings:
The JavaScript is evaluated in the browser for each cell at render time.

Use render for custom HTML

The render property provides custom HTML rendering for a column. It accepts either an inline JavaScript expression or a reference to a named renderer: Inline expression:
Named renderer reference:
display vs renderUse display when you need to select which property of a navigation property to show, or to format it with JavaScript. Use render when you need custom HTML rendering for any column type. When both are set on the same column, render takes precedence for visual output.

Define reusable renderers

The renderers section at the root level of the sheet configuration defines named renderer functions. Each renderer is a JavaScript arrow function string with access to the context object:
Reference a named renderer from any column’s render property:
Use named renderers for consistencyWhen the same display logic applies to multiple columns, define it once in renderers and reference it by name. This avoids duplicating JavaScript across column definitions and makes maintenance easier.

Customize picker display

The list.display property customizes how items appear in dropdown pickers, not in the cell itself:

Context object reference

Dynamic expressions receive a context object. The available properties depend on the evaluation location:
Columns with custom rendering do not show external linksIf a column uses a custom render or JavaScript display function, the automatic external link (the hasUrl feature) will not be displayed for that column. Plan your link rendering within the JavaScript function if you need clickable URLs.

Complete YAML example

Verify

After saving the sheet configuration, reload the powersheet document. You should now see cells rendering custom HTML content — bold text, formatted identifiers, or concatenated values — according to the JavaScript functions you defined. Columns using render or display functions will show the transformed output instead of raw property values.

See also

Last modified on August 31, 2026