@helix-x/datagrid-ui - v0.1.2
    Preparing search index...

    Interface UseEditModelResult<T>

    What useEditModel returns.

    interface UseEditModelResult<T> {
        cancel: () => void;
        commit: () => Promise<void>;
        edit: EditState<T> | null;
        isEditing: (rowId: RowId) => boolean;
        setField: (field: string, value: unknown) => void;
        start: (rowId: RowId, row: T) => void;
    }

    Type Parameters

    • T

      The row type.

    Index
    cancel: () => void

    Close without saving, discarding the draft.

    commit: () => Promise<void>

    Run the commit callback. Keeps the row open if it returns ok: false.

    edit: EditState<T> | null

    The open row, or null when nothing is being edited.

    isEditing: (rowId: RowId) => boolean

    Whether a given row is the one currently open.

    setField: (field: string, value: unknown) => void

    Write one field into the draft. Accepts a dotted path, creating intermediate objects as needed.

    start: (rowId: RowId, row: T) => void

    Open a row for editing, replacing any row already open.