The grid (rendering) ยท console.warn
Column '{colId}' cell.render returned markup, which was written as text. Set allowUnsafeTemplates: true at grid level to insert it as HTML, or return an HTMLElement.
Printed by The grid (rendering), prefixed [lattice], since 1.0.1.
Warnings reference › render-escape:*
- Identifier
render-escape:*- Raised by
- The grid (rendering)
- Since
- 1.0.1
What happened
The renderer returned a string that looks like markup, and the grid wrote it as text - so the tags are visible in the cell rather than interpreted. That is the safe default: a renderer's return value is not trusted as HTML unless the grid has been told to trust it.
The fix
Return a real element (built with document.createElement), which is the recommended route and needs no flag, or set allowUnsafeTemplates: true at grid level if the markup is yours and already sanitised.
The smallest fix
cell: { render: (p) => { const b = document.createElement('b'); b.textContent = p.text; return b; } }
Reference
Covered in full at the API reference.