Initial Selection
You can set an initial cell or range selection when the SpreadsheetViewer mounts using the initialSelection prop.
Interactive Demo
Section titled “Interactive Demo”<SpreadsheetViewer model={model} initialSelection="A1" /><SpreadsheetViewer model={model} initialSelection="B2:D4" /><SpreadsheetViewer model={model} initialSelection="Summary!B5" />The initialSelection prop accepts an A1-style reference string, optionally prefixed with a sheet name.
Programmatic References
Section titled “Programmatic References”You can build a reference programmatically using the re-exported A1Ref class:
import { SpreadsheetViewer, A1Ref } from "@grid-is/mondrian-react";
const ref = new A1Ref(selection, { sheetName: "Summary" });<SpreadsheetViewer model={model} initialSelection={ref.toString()} />;A1-Style Reference Format
Section titled “A1-Style Reference Format”The A1-style reference format follows Excel’s standard notation:
A1- Single cellA1:B5- Range of cellsSheet1!A1- Cell on a specific sheetSheet1!A1:B5- Range on a specific sheet
Related
Section titled “Related”- Handling Events - Listen to selection changes
- Component Props - See all available props