grid-minimal-js — Vanilla Grid Minimal (1k–1M client-generated rows)

The most stripped-down demo: no backend, no DataManager HTTP calls, no localization. A single <vn-grid> fed client-generated rows through StaticDataManager — 1,000 by default, selectable up to 1,000,000 from the toolbar — to exercise the grid's virtualization, sorting, filtering, multiple-row selection, and settings persistence under an in-memory dataset of any size.

What it shows

Script load order (why prefs.js, theme-selector.js and rows-selector.js load first)

theme-selector.js and rows-selector.js are plain (non-module) scripts loaded before vanilla-grid-toolbar.js so <grid-minimal-theme-selector> and <grid-minimal-rows-selector> are upgraded before the toolbar's first synchronous render — the initial empty template, which both selectors live in. That first render happens inside vanilla-grid-toolbar.js's own upgrade reaction, before any deferred type="module" script (like app.js) has run, so a sub-component defined there would still be an un-upgraded plain HTMLElement at that render and never receive the linked grid. (The toolbar does now transition between empty and selected, re-cloning on each switch — but the initial empty render must already have working selectors.) theme-selector.js also defines showLoadingOverlay() / hideLoadingOverlay(), consumed by app.js; and app.js publishes window.sf5CurrentRowCount in the other direction, for rows-selector.js to re-sync from. See the header comment in theme-selector.js for the full explanation.

prefs.js loads before both of them, for a related but separate reason: each selector reads a stored preference while building its dropdown, and the theme restore has to rewrite the <vn-grid theme="…"> attribute before the element upgrades. It reaches window.localStorage directly instead of through the component's VanillaGridLocalStorageProvider, which is one of the modules vanilla-grid.js auto-loads asynchronously and so does not exist yet at that point in parsing.

Run

Serve the workspace root with any static server, then open /samples/grid-minimal-js/index.html. No backend or network access is required — all data is generated in the browser.

Test hook: Playwright overrides the starting row count via a ?rows=<n> query param (see tests/playwright/column-filters.spec.js, tests/playwright/sample-search-box.spec.js) to keep test memory down and pin an exact dataset size. It wins over the toolbar dropdown, which renders nothing while it is present — which also means such a visit never changes the stored size. Without it the demo starts at the last size picked (1,000 on a first visit) and the dropdown is in charge.

Files