Presets
Unsaved: 0 rows, 0 cellsEdited cells get a triangle at the top left, and their row number gets a dot. Typing the original value back removes them. Right-click to revert a cell, a row or the selection. “Take in as server values” makes the rewritten values the saved values (cells you have edited keep your values).
Code for these settings
<SpreadsheetGrid
rows={rows}
columns={columns}
onColumnsChange={setColumns}
onRowsChange={setRows}
rowKeyGetter={(row) => row.id}
height={440}
theme="class"
density="standard"
motion="auto"
showTopBar={true}
showBottomBar={true}
showFilterChipBar={false}
localeText={localeTextEn} // import { localeTextEn } from '@ishibashi0112/spreadsheet-grid/locales/en'
enableSorting={true}
enableColumnFilter={true}
enableGlobalFilter={true}
enableColumnMenu={true}
enableRangeSelection={true}
enableUndoRedo={true}
enableClearOnDelete={true}
readOnly={false}
dimReadOnlyCells={false}
showValidationMarks={true}
// registered in columns: editor: { type: 'date', picker: 'calendar' }
// ship time in columns: editor: { type: 'time', picker: 'list', step: 30 }
// checked at in columns: editor: { type: 'datetime', defaultTime: '09:00', timeInput: true }
// tags in columns: editor: { type: 'select', multiple: true, options: TAGS } (the value is a string[])
trackChanges
onChangesChange={({ rowCount }) => setUnsavedRows(rowCount)}
enableContextMenu
getContextMenuItems={(params) => params.revertItems ?? []}
find
fillHandle
enableRowSelection={false}
scrollHint={{ hintColumn: 'name' }}
columnGroups={[
{ key: 'item', title: 'Product', children: ['name', 'category'] },
{ key: 'order', title: 'Order', collapsible: { keep: ['status'] }, children: ['status', { key: 'amount', title: 'Qty & price', children: ['qty', 'price'] }] },
]}
// in columns, qty: conditionalFormat: { dataBar: {} } / unit price: { colorScale: {} } / status: { chips: { Ordered: 'info', Packing: 'warning', Shipped: 'good', Canceled: 'critical' } }
// columns: product aggFunc: 'count' / qty aggFunc: 'sum' / unit price aggFunc: 'avg'
totalRow
/>