The grid (rendering) ยท console.warn
createStat needs a `container`: an element or a selector.
Printed by The grid (rendering), prefixed [lattice], since 1.10.0.
Warnings reference › stat.container
- Identifier
stat.container- Raised by
- The grid (rendering)
- Since
- 1.10.0
What happened
createStat() had no element to draw into. It returns an inert handle - refresh(), value() and destroy() all work and do nothing - so calling code is safe and nothing appears on screen.
The fix
Pass container as an element or a selector that resolves to one.
The smallest fix
createStat({ grid, container: '#total', col: 'amount', fn: 'sum' });
Reference
Covered in full at the API reference.