Lattice Grid Buy a licence

demo D232

Value diagnostics

A setting the grid cannot use, named on the spot instead of ignored

grid.diagnostics.warnings

Building…
Loading a live grid…

The configuration

'value-diagnostics': () => ({
  rows: SETTING_PROBES.map((p) => ({ id: p.id, setting: p.setting, given: p.given })),
  config: {
    rowKey: 'id',
    autoHeight: true,
    density: 'roomy' as any,
    selection: 'lots' as any,
    columns: [
      { field: 'setting', title: 'Setting', layout: { width: 150, pin: 'start' } },
      { field: 'given', title: 'Given', layout: { width: 130 } },
      {
        id: 'reading',
        title: 'What the grid says',
        layout: { flex: 1, min: 320 },
        sort: false,
        filter: false,
        cell: { wrap: true },
        value: {
          pure: false,
          deps: '*',
          compute: (_deps: unknown, ctx: any) => {
            const diagnostics = ctx?.grid?.diagnostics;
            if (!diagnostics) return 'no diagnostics api';
            return readSettingDiagnostic(ctx?.data?.id, diagnostics);
          },
        },
      },
    ],
  },
  foot: [
    'every line read from this grid, in your browser',
    'a value the grid cannot use is named; a value it understands stays silent',
  ],
})

Catching a setting the grid could not use

Value diagnostics tells you the moment a configuration value is one the grid cannot use, so a mistyped option or a wrong type surfaces while you are building rather than turning up later as a feature that quietly never worked. A value the grid does not understand no longer disappears without a word: the grid names the setting, says what it expected, shows the value it saw, and carries on with the safe default so the grid still renders. A developer reaches for this after wiring up a grid that looks almost right, when a colour scheme did not take, a mode that should be on appears to do nothing, or a value pasted from another config never had any effect. Lattice Grid surfaces each finding on grid.diagnostics.warnings() and in the console, one entry per setting, each naming the option and carrying a plain description of what was wrong. A value the grid understands raises nothing at all: the check is deliberately conservative, so a correct grid stays completely silent and a warning always means a real setting to fix. The demo builds a grid carrying two values it cannot use and reports, live and in your own browser, exactly what the grid said about each one, beside a setting that is correct and stays silent.

How do I find out why a grid setting is being ignored?

Read grid.diagnostics.warnings() for any entry naming that setting. When a configuration value is one the option cannot accept, Lattice Grid reports it by name with a plain description of what it expected and the value it received, in the console and on the diagnostics API, then falls back to the safe default so the grid keeps rendering. A setting that raises no warning is one the grid understood and is using, so the absence of a warning is itself the answer.