Lattice Grid Buy a licence

developer guide

Presenting and saved views: JavaScript Data Grid Guide

Presentation mode for a room, full-screen maximise, the time scrubber, saved views, undo and redo across the whole grid, and the left tool rail.

Developer guide › Presenting and saved views

Presentation mode

Renders the grid for a room: full-screen, application chrome hidden, everything enlarged. The data stays live and queryable throughout, so a question from the audience is answered by filtering in front of them rather than promised as a follow-up.

Maximise

A grid usually lives in whatever box the page layout gave it, and that box is usually too small for the job. The left rail's last button fills the browser window with the grid, and clicking it again puts the grid back exactly where it was. Esc also restores.

Time scrubber

Move the grid back through recent data changes: what did this look like a minute ago, before that number moved.

Saved views

A view is a named grid state: sort, filters, grouping, column order, widths, visibility. There are two kinds and the picker keeps them apart.

Undo

Undo covers the whole grid, not only edits. Sorts, filters, column moves, grouping, an applied view and a restore all record an entry, and each carries a label written for a button.

The left rail

toolPanel: { side: 'left' } docks the panels as an icon rail and turns on the action buttons: undo, redo, export to CSV, export to Excel, copy to the clipboard, print, restore the default view, and maximise. Each is a single click on the thing you came for, and all four export destinations are in the cell context menu as well.

Picking a subset

createGrid(el, {
  toolPanel: {
    side: 'left',
    panels: ['columns', 'filters', 'views', 'quick'],
    // Omit `actions` entirely to take all seven, including any added later.
    actions: ['undo', 'redo', 'export', 'excel', 'clipboard', 'print', 'restore', 'maximise'],
    exportName: 'circuits',
  },
});

An explicit actions array replaces the default rather than extending it. That is what makes it useful (you choose the set and the order) but it also means a config written against an earlier version keeps exactly the buttons it named and silently misses anything added since. If you want whatever the current version offers, leave the key out.

Every action is gated on a predicate rather than always offered, so undo greys out when there is nothing to undo and "restore the default view" greys out when nothing has changed. A rail of seven icons where three do nothing is worse than a rail of four.