demo D305
How much furniture to show
Heading controls, scrollbars and cell alignment, switched on screen
headerControls
Three switches over one grid: whether the heading controls appear on hover, stay put or disappear entirely; whether the scrollbars stay on screen; and whether cell content sits at the top, middle or bottom of its row.
Deciding how much furniture a data grid shows
A grid embedded in a product rarely wants the same amount of chrome as a grid on its own page. A dense read-only report wants clean headings; a table people sort and filter all day wants the controls in plain sight rather than hidden until hover; a dashboard panel on a machine with overlay scrollbars wants the scrollbars pinned so the amount of data below the fold is never a surprise. Lattice Grid puts each of those on a single configuration key, settable as a grid-wide default and overridable on an individual column.
Heading controls, the sort arrow, filter funnel and menu button, can be revealed on hover and keyboard focus, kept visible at all times, or drawn not at all. Hidden also takes them out of the tab order, which is the right behaviour for a heading that is genuinely just a label; sorting and filtering remain reachable from the tool panel and the keyboard, so hiding the furniture never removes the function. Scrollbars can follow the platform’s own behaviour or be kept on screen, on both axes or on one. Cell content can be aligned to the top, middle or foot of its row, which is what a tall row of wrapped text usually needs, and it applies uniformly including to rows that size themselves to their content unless a column opts out.
Each of these is unset or platform-default out of the box, so an existing grid renders exactly as it did until you ask for something different.
How do you keep a data grid’s sort and filter buttons always visible?
Set headerControls to always. The sort arrow, filter funnel and menu button stay on screen instead of appearing on hover. Set it to hidden for a heading that should be a plain label, or leave it on hover for the default behaviour. A column’s own setting overrides the grid’s.
How do you stop a data grid’s scrollbars from fading out?
Set scrollbars to always, which keeps both axes visible whether or not the pointer is over the grid. Pass an object naming each axis to pin only one of them, for example keeping the vertical bar while leaving the horizontal one to the platform.