Skip to main content

DomainFrameEditor

Defined in: js-api/src/ui/domains/domains-editor.ts:310

THE single writer of a domain frame's editing state.

It wraps a DataFrame produced by table.queryDf(...) and attaches three invisible service columns — DomainFrameEditor.STATE_COLUMN, DomainFrameEditor.CHANGES_COLUMN, DomainFrameEditor.ERRORS_COLUMN — that hold everything about the pending batch: which rows are new/modified/deleted, the ORIGINAL value of every changed cell, and the per-cell validation errors. Grids, forms and the save pipeline all read that one state; nothing keeps a parallel store.

const editor = await DomainFrameEditor.create(grok.dapi.domains.table('grit.issue'));
editor.setValue(0, 'title', 'New title'); // tracked, validated, highlighted
await editor.save(); // ONE /transaction

Every service column is tagged out of binary AND csv export, so the state is memory-only: a saved project, toByteArray(), toCsv(), an export or a batch() upload built from the frame never carry it.

Writing. Go through setValue (programmatic) or beginEdit + commitEdit (an in-grid edit, where the grid has already written the cell). Writing a cell directly on the DataFrame bypasses the tracking and the value is silently NOT saved.

Deleted rows stay in the frame and are hidden by ANDing them out of the filter bitset on every filter recomputation, so undoing a delete (unmarkDeleted) is trivial and row order never moves. The mirror case — a row the server already deleted, staged to come back by markRestored — stays VISIBLE for the same reason: it is a pending change the user must see.

Refreshing discards edits — BY DESIGN. refresh re-runs the query and rebuilds the frame and its state from scratch; there is no merge and never will be. Deciding whether it is safe to refresh is the CALLER's job: read isDirty / subscribe to onDirtyChanged and prompt (save / discard / cancel) before calling it. A component that refreshes on a timer or on a route change without that check WILL eat a user's batch edits.

Implements

Properties

PropertyModifierTypeDefault valueDescriptionDefined in
accessreadonlyDomainAccessundefinedEffective access of the current user, SNAPSHOT when the editor was created — what read-only degradation and the writable-column payload filter derive from. A later grok.dapi.domains.invalidateUiCaches() (or a grant change) does NOT reach an existing editor: re-create it to pick the new permissions up.js-api/src/ui/domains/domains-editor.ts:398
clientreadonlyDomainTableClientundefinedThe table the frame's rows belong to.js-api/src/ui/domains/domains-editor.ts:392
quietreadonlybooleanundefinedSee DomainFrameEditorOptions.quiet.js-api/src/ui/domains/domains-editor.ts:379
CHANGES_COLUMNreadonly"~changes"'~changes'JSON column holding the ORIGINAL values of changed cells only (sparse).js-api/src/ui/domains/domains-editor.ts:314
DRAFT_ID_PREFIXreadonly"~new:"'~new:'Prefix of the id addRow stamps into a row that does not exist on the server yet: ~new:<uuid>. Another row (of this or of another editor in the same DomainSession) may hold it in a ref column — buildOps turns it into the transaction's $ref and the server resolves it.js-api/src/ui/domains/domains-editor.ts:328
ERRORS_COLUMNreadonly"~errors"'~errors'JSON column holding per-cell DomainCellErrors.js-api/src/ui/domains/domains-editor.ts:316
LIVE_ROWSreadonlyRegExpundefinedThe referential refusal the server sends back, which names the child table and the column pointing here (DomainRepository._checkDeletable) — restrictRefusal says it in the user's words.js-api/src/ui/domains/domains-editor.ts:333
SERVICE_COLUMNSreadonlyreadonly string[]undefinedThe three service columns an editor attaches — every one of them tagged out of binary AND csv export, so the editing state can never reach a saved project, an export, an upload, or a batch() fed from the frame.js-api/src/ui/domains/domains-editor.ts:321
STATE_COLUMNreadonly"~state"'~state'Row state column: `'''new'

Accessors

changeCount

Get Signature

get changeCount(): number

Defined in: js-api/src/ui/domains/domains-editor.ts:595

Number of pending cell changes — what a "N unsaved changes" bar shows.

Returns

number


dataFrame

Get Signature

get dataFrame(): DataFrame

Defined in: js-api/src/ui/domains/domains-editor.ts:576

The frame being edited. It is REPLACED by refresh — re-read it (or subscribe to onRefreshed) instead of caching it.

Returns

DataFrame


errorCount

Get Signature

get errorCount(): number

Defined in: js-api/src/ui/domains/domains-editor.ts:839

Number of cells whose problem blocks save.

Returns

number


isDirty

Get Signature

get isDirty(): boolean

Defined in: js-api/src/ui/domains/domains-editor.ts:588

Whether anything is pending (a changed cell, a new row, a deleted row).

Returns

boolean


isSaving

Get Signature

get isSaving(): boolean

Defined in: js-api/src/ui/domains/domains-editor.ts:592

Whether a save is in flight. While it is, the editor refuses every write, discard and refresh — see save.

Returns

boolean

Implementation of

IFrameEditor.isSaving


onChanged

Get Signature

get onChanged(): Observable<DomainFrameEditor>

Defined in: js-api/src/ui/domains/domains-editor.ts:598

Fires on every service-state write — the repaint hook for a grid.

Returns

Observable<DomainFrameEditor>

Implementation of

IFrameEditor.onChanged


onConflict

Get Signature

get onConflict(): Observable<DomainVersionConflictError>

Defined in: js-api/src/ui/domains/domains-editor.ts:606

Fires when a save hits a version conflict, BEFORE the standard dialog.

Returns

Observable<DomainVersionConflictError>


onDirtyChanged

Get Signature

get onDirtyChanged(): Observable<boolean>

Defined in: js-api/src/ui/domains/domains-editor.ts:600

Fires when isDirty flips — what a caller's refresh policy listens to.

Returns

Observable<boolean>


onRefreshed

Get Signature

get onRefreshed(): Observable<DataFrame>

Defined in: js-api/src/ui/domains/domains-editor.ts:608

Fires with the NEW frame after refresh rebuilt it.

Returns

Observable<DataFrame>

Fires with the NEW frame when the editor rebuilt it — the grid rebinds.

Implementation of

IFrameEditor.onRefreshed


onRefused

Get Signature

get onRefused(): Observable<DomainEditRefusal>

Defined in: js-api/src/ui/domains/domains-editor.ts:611

Fires when the HOST refused an edit (refuse) — what a status line shows next to the grid's balloon.

Returns

Observable<DomainEditRefusal>


onSaved

Get Signature

get onSaved(): Observable<DomainSaveResult>

Defined in: js-api/src/ui/domains/domains-editor.ts:604

Fires after a successful save.

Returns

Observable<DomainSaveResult>


onSavingChanged

Get Signature

get onSavingChanged(): Observable<boolean>

Defined in: js-api/src/ui/domains/domains-editor.ts:602

Fires when isSaving flips — what a grid locks its editing on.

Returns

Observable<boolean>

Implementation of

IFrameEditor.onSavingChanged


properties

Get Signature

get properties(): Property[]

Defined in: js-api/src/ui/domains/domains-editor.ts:582

Registry Property metadata of the table's declared columns.

Returns

Property[]


query

Get Signature

get query(): DomainQuerySpec<string, string> | undefined

Defined in: js-api/src/ui/domains/domains-editor.ts:585

The query refresh re-runs.

Returns

DomainQuerySpec<string, string> | undefined


table

Get Signature

get table(): string

Defined in: js-api/src/ui/domains/domains-editor.ts:579

'<schema>.<table>'.

Returns

string


writableColumns

Get Signature

get writableColumns(): string[] | null

Defined in: js-api/src/ui/domains/domains-editor.ts:421

IFrameEditor: null when NOTHING in the frame can be edited — no table-level edit or insert, and no per-row ~can_edit to override them — otherwise the columns the field rights let anyone write, canEdit deciding the ROW dimension per cell. A row-mode frame answers the list while the table-level edit is false, or the whole grid would lock.

Returns

string[] | null

The columns the user may edit; null (or empty) when NOTHING in the frame can be edited — the whole grid is read-only.

Implementation of

IFrameEditor.writableColumns

Methods

addRow()

addRow(values?, options?): number

Defined in: js-api/src/ui/domains/domains-editor.ts:704

Appends a new, unsaved row (state 'new'), optionally prefilled; returns its index (-1 when refused because a save is in flight).

options.pristine adds it as a row nobody has written to YET: it is part of the batch a save writes, but it contributes NOTHING to changeCount / isDirty until the first setValue or commitEdit — the "pristine until touched" contract of an insert form, whose untouched (however prefilled) row must not arm the unsaved-changes gate. A row added by a USER gesture (the grid's Add row) is pending immediately, which is the default.

Parameters

ParameterType
values?{[column: string]: any; }
options?{ pristine?: boolean; }
options.pristine?boolean

Returns

number


applyResults()

applyResults(pending, results, assigned?): Promise<DomainSaveResult>

Defined in: js-api/src/ui/domains/domains-editor.ts:988

Lands this editor's slice of a successful transaction: returned ids and versions into the frame, every cell holding a draft id the transaction resolved (this editor's, or another participant's through [assigned] — the DomainSession collects the whole batch's map before the first slice is applied), then every OTHER server-assigned column of the rows it wrote (writeBack), row state cleared, deleted rows removed.

onSaved fires LAST, once the re-read has landed: a host that rebuilds on it (a form's system footer, a list) must see the server's rows — the transaction answers {id, version, created} per insert and nothing else, so number, created_on, updated_on and author_id exist only after it.

Parameters

ParameterType
pendingDomainPendingOp[]
resultsany[]
assigned?{[draftId: string]: string; }

Returns

Promise<DomainSaveResult>


beginEdit()

beginEdit(row): void

Defined in: js-api/src/ui/domains/domains-editor.ts:650

Snapshots [row]'s current values so a following commitEdit knows what the cell held BEFORE the edit. A grid calls this when the cell becomes current — an edit can only start there. Without a snapshot the edit is still tracked and saved, it just cannot be reverted.

Parameters

ParameterType
rownumber

Returns

void

Implementation of

IFrameEditor.beginEdit


buildOps()

buildOps(): DomainPendingOp[]

Defined in: js-api/src/ui/domains/domains-editor.ts:871

The pending batch as transaction ops, in row order: 'new' rows insert their writable values (naming their draft id as the op's ref), 'modified' rows update ONLY their changed columns with the row's expectedVersion, 'deleted' rows delete, 'restored' rows carry their id alone and undo a landed soft delete. Exposed so a caller can inspect or extend the payload; a DomainSession concatenates several editors' into one transaction.

A value equal to a draft id — this editor's or another's — goes out as the '$<draftId>' reference the server resolves; a literal leading $ is escaped as $$. An empty cell of a NEW row is LEFT OUT of the insert rather than sent as an explicit null, so the column takes its server-side default; a column with no default and no value is rejected by the server's own nullability check (and by validate before that). Clearing a cell of a MODIFIED row does send null — that is an edit, not an omission.

Every insert carries onDuplicate: 'error': a business-key conflict fails the whole transaction (409) instead of silently merging the new row into an existing one.

Returns

DomainPendingOp[]


canEdit()

canEdit(row, column): boolean

Defined in: js-api/src/ui/domains/domains-editor.ts:432

IFrameEditor: whether [column] of [row] may be edited — a writable column, plus the row's own right: a draft needs insert; a persisted row carries ~can_edit in row mode (a withAccess read), and falls back to the table-level edit where the frame has no such column.

Parameters

ParameterType
rownumber
columnstring

Returns

boolean

Implementation of

IFrameEditor.canEdit


changesOf()

changesOf(row): object

Defined in: js-api/src/ui/domains/domains-editor.ts:624

ORIGINAL values of [row]'s changed cells, keyed by column (empty when the row is unchanged; always empty for a 'new' row — all of its values are new). Read-only: the object is the editor's own cached parse, and writing to it changes nothing on the frame.

Parameters

ParameterType
rownumber

Returns

object


clearSnapshots()

clearSnapshots(): void

Defined in: js-api/src/ui/domains/domains-editor.ts:667

Drops the beginEdit snapshots. A HOST that rewrites row values IN PLACE (a re-query refreshing the same frame object, with no row-count change and no frame event) MUST call this afterwards: the snapshots are keyed by row index and would otherwise record the OLD rows' values as edit originals (STATE-CONTRACT H8).

Returns

void


commitEdit()

commitEdit(row, column): void

Defined in: js-api/src/ui/domains/domains-editor.ts:684

Tracks a cell the GRID already wrote (its onCellValueEdited path); the original comes from the beginEdit snapshot.

Parameters

ParameterType
rownumber
columnstring

Returns

void

Implementation of

IFrameEditor.commitEdit


detach()

detach(): void

Defined in: js-api/src/ui/domains/domains-editor.ts:1281

Releases the frame subscriptions. The service columns stay on the frame — drop the frame, or remove them, if it outlives the editor.

Returns

void


discard()

discard(): void

Defined in: js-api/src/ui/domains/domains-editor.ts:798

Drops the whole pending batch: changed cells go back to their originals, new rows are removed, deleted rows are restored and staged restores go back to being landed deletions. Refused while a save is in flight — removing rows under the transaction would make its results land on the wrong ones.

Returns

void


duplicateRefusal()

duplicateRefusal(row, e?): Promise<string>

Defined in: js-api/src/ui/domains/domains-editor.ts:1204

"CAS 64-17-5 already belongs to Ethanol": the key's caption and the value at hand, and the row that already holds it — read back through the id the refusal carries, or looked up by the key itself where it carries none: on the UPDATE path the id is the row being SAVED (repository.dart _mapPgError(rt, x, id: id)), which names the wrong row.

Parameters

ParameterType
rownumber
e?DomainValidationError

Returns

Promise<string>


errorOf()

errorOf(row, column): DomainCellError | null

Defined in: js-api/src/ui/domains/domains-editor.ts:640

The cell's problem, or null.

Parameters

ParameterType
rownumber
columnstring

Returns

DomainCellError | null

Implementation of

IFrameEditor.errorOf


errorsOf()

errorsOf(row): object

Defined in: js-api/src/ui/domains/domains-editor.ts:630

Per-cell problems of [row], keyed by column. Read-only, see changesOf.

Parameters

ParameterType
rownumber

Returns

object


isChanged()

isChanged(row, column): boolean

Defined in: js-api/src/ui/domains/domains-editor.ts:635

Whether the cell carries a pending change (what highlighting keys on).

Parameters

ParameterType
rownumber
columnstring

Returns

boolean

Implementation of

IFrameEditor.isChanged


mapValidationError()

mapValidationError(e, failing, duplicateText?): void

Defined in: js-api/src/ui/domains/domains-editor.ts:1170

rows[0].errors[{column, message}] of a rejected op onto that row's cells; an error naming no known column marks every changed cell of the row. [duplicateText] is what a business-key clash says — refusalFor's sentence, so the cell, the status line reading it and the balloon all say the same thing.

Parameters

ParameterType
eDomainValidationError
failingDomainPendingOp
duplicateText?string

Returns

void


markDeleted()

markDeleted(rows): void

Defined in: js-api/src/ui/domains/domains-editor.ts:740

Marks rows deleted: they stay in the frame (order untouched) and are excluded from the filter until save removes them for real.

Parameters

ParameterType
rowsnumber | number[]

Returns

void


markRestored()

markRestored(rows): void

Defined in: js-api/src/ui/domains/domains-editor.ts:755

Stages the restore of rows the SERVER has soft-deleted: they ride the next save as one restore op of the same transaction, exactly as a delete does. Refused on a row the frame does not answer as deleted (~is_deleted) — a restore is the undo of a landed delete, not an edit.

Parameters

ParameterType
rowsnumber | number[]

Returns

void


prepareSave()

prepareSave(): DomainPendingOp[] | null

Defined in: js-api/src/ui/domains/domains-editor.ts:955

The batch a DomainSession takes from this editor: null when the editor refuses (a blocking cell error, named in a balloon), else the ops of buildOps — after a row added and then deleted in the same batch has been resolved LOCALLY (removed from the frame: it never reached the server, so it can neither survive the save as phantom pending state nor hold the batch dirty).

Returns

DomainPendingOp[] | null


rebind()

rebind(assigned): void

Defined in: js-api/src/ui/domains/domains-editor.ts:1060

Rewrites every cell holding a draft id the transaction resolved ([assigned] maps draft id → server id) to the real id, WITHOUT touching the row's editing state: a pristine row stays pristine, a clean row stays clean, and nothing is recorded as a change.

applyResults does this for the editors that took part in the batch; a DomainSession applies it to the ones that did NOT — a pristine child holding a ~new: reference to a parent the batch just created keeps a dangling draft id otherwise.

Only a cell whose whole value IS a draft id is rewritten — never the '$~new:…' wire form buildOps escapes to, and never a substring.

Parameters

ParameterType
assigned{[draftId: string]: string; }

Returns

void


refresh()

refresh(query?): Promise<DataFrame>

Defined in: js-api/src/ui/domains/domains-editor.ts:1265

Rebuilds the frame from the server: re-runs [query] (the attached one by default) and re-attaches the service columns from scratch.

Pending edits do NOT survive this — by design. There is no merge: the control is refresh-agnostic and this method never reconciles old and new state. Deciding WHETHER to refresh while edits are pending is the caller's responsibility — check isDirty (or subscribe to onDirtyChanged) and prompt the user to save or discard first.

Resolves to the NEW frame, which also arrives on onRefreshed: a grid bound to the old one must rebind. Refused (resolving to the CURRENT frame, with a warning) while a save is in flight — the resolved value alone does not tell a refusal from a rebuild, so check isSaving first (or compare the frame identity) when it matters.

Parameters

ParameterType
query?DomainQuerySpec<string, string>

Returns

Promise<DataFrame>


refusalFor()

refusalFor(e, failing): Promise<string>

Defined in: js-api/src/ui/domains/domains-editor.ts:1192

What a refused save means to the user, in the table's own vocabulary — the business key and the row that already holds it, the children that keep a row alive. The server's own message stands where the refusal is not one this editor can put in the table's words.

Parameters

ParameterType
eany
failingDomainPendingOp

Returns

Promise<string>


refusalOf()

refusalOf(row, column): string | null

Defined in: js-api/src/ui/domains/domains-editor.ts:446

IFrameEditor: why [column] of [row] may not be edited, in the words the table itself uses — the column's caption where the field is read-only for everyone, the row's own name where the row is; null when the cell may be edited.

Parameters

ParameterType
rownumber
columnstring

Returns

string | null

Implementation of

IFrameEditor.refusalOf


refuse()

refuse(row, column, message): void

Defined in: js-api/src/ui/domains/domains-editor.ts:457

IFrameEditor: an edit the HOST refused (refusalOf said why) — reported on onRefused, so a host with a status line says it there too and not only in the grid's balloon. Nothing is written to the frame: a refused edit never happened.

Parameters

ParameterType
rownumber
columnstring
messagestring

Returns

void

Implementation of

IFrameEditor.refuse


resolveConflict()

resolveConflict(e, failing): Promise<boolean>

Defined in: js-api/src/ui/domains/domains-editor.ts:1129

The platform's standard reload/overwrite dialog for a version conflict on [failing], with the outcome applied: RELOAD takes the server's values for that ONE row (dropping its edits), OVERWRITE takes the current version. Resolves to whether the batch should be rebuilt and retried; false when the user dismissed it, in which case the row's changed cells say why.

Parameters

ParameterType
eDomainVersionConflictError
failingDomainPendingOp

Returns

Promise<boolean>


restrictRefusal()

restrictRefusal(e): Promise<string>

Defined in: js-api/src/ui/domains/domains-editor.ts:1218

"Ethanol still has 3 containers; remove or reassign them first": the server names the child table and the column pointing back here, the child table itself the count and the noun.

Parameters

ParameterType
eDomainError

Returns

Promise<string>


revertCell()

revertCell(row, column): void

Defined in: js-api/src/ui/domains/domains-editor.ts:766

Restores one cell to its original value and drops its change entry. Refused while a save is in flight.

Parameters

ParameterType
rownumber
columnstring

Returns

void


revertRow()

revertRow(row): void

Defined in: js-api/src/ui/domains/domains-editor.ts:786

revertCell for every changed cell of [row].

Parameters

ParameterType
rownumber

Returns

void


save()

save(): Promise<boolean>

Defined in: js-api/src/ui/domains/domains-editor.ts:938

Writes the whole pending batch as ONE /transaction: audit rows share a tx_id, and any failure rolls every op back. Resolves to whether the batch landed. A session of one — see DomainSession.save for the flow (blocking errors, the conflict dialog, validation errors on cells) and for saving several editors together.

The editor is CLOSED while this runs (isSaving): every write, discard and refresh is refused with a warning instead of being silently lost between the request and its results (and, for the row-removing ones, instead of shifting the rows the results address). A grid bound to the editor locks its own editing off onSavingChanged.

Returns

Promise<boolean>


setSaving()

setSaving(saving): void

Defined in: js-api/src/ui/domains/domains-editor.ts:1244

Opens/closes the editor around a transaction (see save); a DomainSession sets it on every participant.

Parameters

ParameterType
savingboolean

Returns

void


setValue()

setValue(row, column, value): void

Defined in: js-api/src/ui/domains/domains-editor.ts:674

Writes [value] into the cell AND tracks it — the programmatic write path (a form field, a paste, a fill-down). Refused while a save is in flight.

Parameters

ParameterType
rownumber
columnstring
valueany

Returns

void


stateOf()

stateOf(row): DomainRowState

Defined in: js-api/src/ui/domains/domains-editor.ts:616

Editing state of [row].

Parameters

ParameterType
rownumber

Returns

DomainRowState


unmarkDeleted()

unmarkDeleted(rows): void

Defined in: js-api/src/ui/domains/domains-editor.ts:747

Undoes markDeleted, restoring whatever the row was before — a row added in this batch goes back to 'new', an edited one back to 'modified'.

Parameters

ParameterType
rowsnumber | number[]

Returns

void


unmarkRestored()

unmarkRestored(rows): void

Defined in: js-api/src/ui/domains/domains-editor.ts:760

Undoes markRestored: the row goes back to being a landed deletion.

Parameters

ParameterType
rowsnumber | number[]

Returns

void


validate()

validate(): number

Defined in: js-api/src/ui/domains/domains-editor.ts:824

Re-runs every cell validator over the pending batch; returns the number of blocking (kind: 'error') cells. Call it before offering Save when values arrived from outside setValue. Refused (reporting the CURRENT count) while a save is in flight — it writes the state columns like every other mutator.

Returns

number


writeBack()

writeBack(pending, results): Promise<void>

Defined in: js-api/src/ui/domains/domains-editor.ts:1091

Re-reads the rows a save inserted or updated and lands EVERY returned column in the frame — server defaults, the autoNumber number, created_on/author_id/updated_on, the per-row ~can_* — so a host reading the frame after a save sees the server's row, not the payload it sent. Run by applyResults before onSaved; ENRICHES only — it fails soft, and the ids, versions and resolved draft references applyResults wrote stand without it.

Parameters

ParameterType
pendingDomainPendingOp[]
resultsany[]

Returns

Promise<void>


assignedOf()

static assignedOf(pending, results): object

Defined in: js-api/src/ui/domains/domains-editor.ts:344

The draft id of every insert of [pending] → the id the server gave it.

Parameters

ParameterType
pendingDomainPendingOp[]
resultsany[]

Returns

object


attach()

static attach(dataFrame, client, options?): Promise<DomainFrameEditor>

Defined in: js-api/src/ui/domains/domains-editor.ts:464

Attaches the editing state to an EXISTING frame of [client]'s rows (a queryDf result). Pass options.query so refresh knows what to re-run.

Parameters

ParameterType
dataFrameDataFrame
clientDomainTableClient
options?DomainFrameEditorOptions

Returns

Promise<DomainFrameEditor>


attachTo()

static attachTo(dataFrame, schema, table, options?): Promise<DomainFrameEditor>

Defined in: js-api/src/ui/domains/domains-editor.ts:478

attach for a host that has a frame and a table address but no client of its own — the entry point of the Dart Domain View's grid mode, which owns its frame and hands it over to be edited.

Parameters

ParameterType
dataFrameDataFrame
schemastring
tablestring
options?DomainFrameEditorOptions

Returns

Promise<DomainFrameEditor>


create()

static create(client, options?): Promise<DomainFrameEditor>

Defined in: js-api/src/ui/domains/domains-editor.ts:486

Runs options.query (everything the caller may see, by default) and attaches to the resulting frame.

Parameters

ParameterType
clientDomainTableClient
options?DomainFrameEditorOptions

Returns

Promise<DomainFrameEditor>


draftId()

static draftId(): string

Defined in: js-api/src/ui/domains/domains-editor.ts:339

Returns

string


editorsOf()

static editorsOf(widget): DomainFrameEditor[]

Defined in: js-api/src/ui/domains/domains-editor.ts:569

The editors [widget] answers for, or none — the duck-typed read of IEditorHost a container uses on children of any class.

Parameters

ParameterType
widgetany

Returns

DomainFrameEditor[]


forContext()

static forContext(context, options?): DomainFrameEditor

Defined in: js-api/src/ui/domains/domains-editor.ts:499

SYNCHRONOUS: an editor over an EMPTY frame of [context]'s declared columns — everything attach awaits is already in the prefetched context, so a widget factory can build its editor without a round trip and load the rows afterwards (refresh, which replaces the frame and fires onRefreshed).

Parameters

ParameterType
contextIDomainTableContext
options?DomainFrameEditorOptions

Returns

DomainFrameEditor


forRows()

static forRows(client, values, options?): Promise<DomainFrameEditor>

Defined in: js-api/src/ui/domains/domains-editor.ts:522

Builds an editor over rows that do NOT come from the server: a frame is built locally from the table's declared columns and every entry of [values] is added as a 'new' row — the INSERT path of a form (domains.table(...).form({values})), with no query round trip.

The added rows are PRISTINE: an unsaved row the user has not written to yet is not a pending change (see addRow), so an untouched New form has nothing to prompt about.

Everything else is identical to create: the same single-writer model, the same service columns and export tags, the same validation, and a save that writes the batch as one transaction. refresh has nothing to re-run unless options.query says otherwise — and re-running it would replace these rows, which is why a form never refreshes.

Parameters

ParameterType
clientDomainTableClient
valuesobject[]
options?DomainFrameEditorOptions

Returns

Promise<DomainFrameEditor>


isDraftId()

static isDraftId(v): boolean

Defined in: js-api/src/ui/domains/domains-editor.ts:335

Parameters

ParameterType
vunknown

Returns

boolean


isReferenceProperty()

static isReferenceProperty(p): boolean

Defined in: js-api/src/ui/domains/domains-editor.ts:562

Whether [p] addresses another row rather than carrying a value of its own — a ref column (semType '<schema>.<table>') or a user/group column. Those hold uuids: a picker is their editing path, not a text cell.

Parameters

ParameterType
pProperty

Returns

boolean


validateCellValue()

static validateCellValue(p, value): string | null

Defined in: js-api/src/ui/domains/domains-editor.ts:541

Validates one cell value against its registry Property — the same constraints the server re-runs on write, producing the server's exact message texts so an inline marker and a rejected save read identically.

Numeric properties take a dart2js-safe path (under dart2js every whole number is double, which would reject every integer), and string_list values are left to the server, which coerces them. Returns null when the value is fine.

Parameters

ParameterType
pProperty
valueany

Returns

string | null


writableColumns()

static writableColumns(access): string[]

Defined in: js-api/src/ui/domains/domains-editor.ts:412

The columns [access] lets the caller write, in the server's (declared) order.

Parameters

ParameterType
accessDomainAccess

Returns

string[]