Skip to content

@jsvision/datagrid / isEditable

Function: isEditable()

isEditable<T>(col): boolean

Defined in: datagrid/src/column.ts:227

Whether a column can be edited: it round-trips text through both parse (text → value) and set (value → record). A column missing either is read-only — the cursor still lands on it for navigation, but begin-edit is a no-op.

Type Parameters

T

T

Parameters

col

GridColumn<T>

The column to test.

Returns

boolean

true when the column defines both parse and set.

Example

ts
import { column, isEditable } from '@jsvision/datagrid';
interface Person { name: string; }
const name = column({
  id: 'name', title: 'Name', value: (r: Person) => r.name,
  parse: (t) => t, set: (r, v) => { r.name = v; },
});
const label = column({ id: 'label', title: 'Label', value: (r: Person) => r.name }); // no parse/set
isEditable(name);  // true
isEditable(label); // false