Per-column edit lock
Prop showColumnEditToggle — adapter chrome, default false.
Guide
When to use it
Let an end-user make an editable column read-only at runtime — no code change, no redeploy.
How it works
Adds a per-column lock / unlock (✏️) control to the columns menu that overrides the column's
meta.editable at runtime via runtime.setColumnEditable.
Gotchas
- Requires
enableEditing— there's nothing to lock without an edit session. - It's an adapter control, not a settings-sheet toggle.
Live example
Example source
import React from 'react'
import { BstTableMui } from '@bloomskill/table-mui'
import type { BstTableColumn } from '@bloomskill/table-engine'
import '@bloomskill/table-engine/styles.css'
type Row = { id: string; name: string; team: string; role: string; score: number }
const seed: Row[] = [
{ id: '1', name: 'Ada Lovelace', team: 'Platform', role: 'Engineer', score: 92 },
{ id: '2', name: 'Alan Turing', team: 'Research', role: 'Scientist', score: 88 },
{ id: '3', name: 'Grace Hopper', team: 'Platform', role: 'Engineer', score: 95 },
{ id: '4', name: 'Katherine J.', team: 'Research', role: 'Analyst', score: 90 },
{ id: '5', name: 'Edsger Dijkstra', team: 'Platform', role: 'Architect', score: 84 },
]
const columns: BstTableColumn<Row>[] = [
{ id: 'name', accessorKey: 'name', header: 'Name' },
{ id: 'team', accessorKey: 'team', header: 'Team' },
{ id: 'role', accessorKey: 'role', header: 'Role' },
{ id: 'score', accessorKey: 'score', header: 'Score', sortFn: 'basic' },
]
const editable: BstTableColumn<Row>[] = columns.map((c) =>
c.id === 'name' || c.id === 'score'
? { ...c, meta: { type: c.id === 'score' ? 'number' : 'text', editable: true } }
: c,
)
export default function App() {
const [rows, setRows] = React.useState(seed)
// Open the Columns menu → lock / unlock a column's editability at runtime.
return (
<BstTableMui data={rows} columns={editable} getRowId={(r) => r.id}
enableEditing showColumnEditToggle showColumnsMenu onDataChange={setRows} />
)
}
Loading live example…
Overview
| Layer | show* (chrome, resolved in the adapter) |
| Type | boolean |
| Default | false |
| Maps to | adapter Columns-menu lock/unlock (✏️) per editable column → engine runtime.setColumnEditable overrides meta.editable at runtime (store columnEdit). Requires enableEditing. Not a BstTableEngineToggles flag (no settings-sheet entry) |
| Status | ✅ done |
| Since | v0.27.0 |
Enable it
<BstTableMui
data={rows}
columns={columns}
enableEditing // chrome is a no-op without its behaviour flag
showColumnEditToggle
/>
Swap
BstTableMuiforBstTableShadcn(and the CSS import) for the shadcn skin — same props.
Behavior & interactions
- Requires
enableEditingto be on — this flag is a no-op otherwise.
Spec coverage
Spec codes (
A1,C2,X8, …) are Bst-Table's internal requirement IDs from the capability matrix;P0–P2mark the delivery phase. They are traceability tags, not part of the public API.
- F3 · Disable column — ✅ built. P3 — meta.disabled