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
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
access | readonly | DomainAccess | undefined | Effective 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:401 |
client | readonly | DomainTableClient | undefined | The table the frame's rows belong to. | js-api/src/ui/domains/domains-editor.ts:395 |
quiet | readonly | boolean | undefined | See DomainFrameEditorOptions.quiet. | js-api/src/ui/domains/domains-editor.ts:382 |
CHANGES_COLUMN | readonly | "~changes" | '~changes' | JSON column holding the ORIGINAL values of changed cells only (sparse). | js-api/src/ui/domains/domains-editor.ts:314 |
DRAFT_ID_PREFIX | readonly | "~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_COLUMN | readonly | "~errors" | '~errors' | JSON column holding per-cell DomainCellErrors. | js-api/src/ui/domains/domains-editor.ts:316 |
LIVE_ROWS | readonly | RegExp | undefined | The 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_COLUMNS | readonly | readonly string[] | undefined | The 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_COLUMN | readonly | "~state" | '~state' | Row state column: `'' | 'new' |
Accessors
changeCount
Get Signature
get changeCount():
number
Defined in: js-api/src/ui/domains/domains-editor.ts:614
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:595
The frame being edited. It is REPLACED by refresh — re-read it (or subscribe to onRefreshed) instead of caching it.
Returns
errorCount
Get Signature
get errorCount():
number
Defined in: js-api/src/ui/domains/domains-editor.ts:865
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:607
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:611
Whether a save is in flight. While it is, the editor refuses every write, discard and refresh — see save.
Returns
boolean
Implementation of
onChanged
Get Signature
get onChanged():
Observable<DomainFrameEditor>
Defined in: js-api/src/ui/domains/domains-editor.ts:617
Fires on every service-state write — the repaint hook for a grid.
Returns
Observable<DomainFrameEditor>
Implementation of
onConflict
Get Signature
get onConflict():
Observable<DomainVersionConflictError>
Defined in: js-api/src/ui/domains/domains-editor.ts:625
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:619
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:627
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
onRefused
Get Signature
get onRefused():
Observable<DomainEditRefusal>
Defined in: js-api/src/ui/domains/domains-editor.ts:630
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:623
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:621
Fires when isSaving flips — what a grid locks its editing on.
Returns
Observable<boolean>
Implementation of
properties
Get Signature
get properties():
Property[]
Defined in: js-api/src/ui/domains/domains-editor.ts:601
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:604
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:598
'<schema>.<table>'.
Returns
string
writableColumns
Get Signature
get writableColumns():
string[] |null
Defined in: js-api/src/ui/domains/domains-editor.ts:433
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 on SOME row (the
immutable ones included where a draft may be added), 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
Methods
_expectedConflictDialog()
protected_expectedConflictDialog(e,row,subject):Promise<"reload"|"overwrite"|null>
Defined in: js-api/src/ui/domains/domains-editor.ts:1259
"<subject> changed since you read it": a Column | You read | Now | Yours table over the guard
columns (Now empty when the body carries no current), and the three answers. "Now" is what
the server read AFTER refusing the write. A test answers it by clicking its buttons.
Parameters
| Parameter | Type |
|---|---|
e | DomainVersionConflictError |
row | number |
subject | string |
Returns
Promise<"reload" | "overwrite" | null>
addRow()
addRow(
values?,options?):number
Defined in: js-api/src/ui/domains/domains-editor.ts:723
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
| Parameter | Type |
|---|---|
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:1058
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
| Parameter | Type |
|---|---|
pending | DomainPendingOp[] |
results | any[] |
assigned? | {[draftId: string]: string; } |
Returns
Promise<DomainSaveResult>
beginEdit()
beginEdit(
row):void
Defined in: js-api/src/ui/domains/domains-editor.ts:669
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
| Parameter | Type |
|---|---|
row | number |
Returns
void
Implementation of
buildOps()
buildOps():
DomainPendingOp[]
Defined in: js-api/src/ui/domains/domains-editor.ts:902
The pending batch as transaction ops, in row order: 'new' rows insert
their writable values, immutable keys included (naming their draft id as the
op's ref), 'modified' rows update ONLY their changed columns — never an
immutable one — guarded as access.support.concurrency says: 'version' sends
the row's expectedVersion, 'expected' the ORIGINAL values of the changed columns
(_guardOf — a partial guard: only the columns whose declared type the warehouse can
compare, so an edit touching floats, datetimes, refs or empty originals alone carries none),
'none' nothing. '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
bool cell has no empty state and is always sent, so a NOT NULL bool default is
not preserved); 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
canEdit()
canEdit(
row,column):boolean
Defined in: js-api/src/ui/domains/domains-editor.ts:444
IFrameEditor: whether [column] of [row] may be edited — a writable
column (an immutable one on a draft only), 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
| Parameter | Type |
|---|---|
row | number |
column | string |
Returns
boolean
Implementation of
changesOf()
changesOf(
row):object
Defined in: js-api/src/ui/domains/domains-editor.ts:643
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
| Parameter | Type |
|---|---|
row | number |
Returns
object
clearSnapshots()
clearSnapshots():
void
Defined in: js-api/src/ui/domains/domains-editor.ts:686
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:703
Tracks a cell the GRID already wrote (its onCellValueEdited path); the
original comes from the beginEdit snapshot.
Parameters
| Parameter | Type |
|---|---|
row | number |
column | string |
Returns
void
Implementation of
detach()
detach():
void
Defined in: js-api/src/ui/domains/domains-editor.ts:1403
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:823
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:1323
"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
| Parameter | Type |
|---|---|
row | number |
e? | DomainValidationError |
Returns
Promise<string>
errorOf()
errorOf(
row,column):DomainCellError|null
Defined in: js-api/src/ui/domains/domains-editor.ts:659
The cell's problem, or null.
Parameters
| Parameter | Type |
|---|---|
row | number |
column | string |
Returns
DomainCellError | null
Implementation of
errorsOf()
errorsOf(
row):object
Defined in: js-api/src/ui/domains/domains-editor.ts:649
Per-cell problems of [row], keyed by column. Read-only, see changesOf.
Parameters
| Parameter | Type |
|---|---|
row | number |
Returns
object
isChanged()
isChanged(
row,column):boolean
Defined in: js-api/src/ui/domains/domains-editor.ts:654
Whether the cell carries a pending change (what highlighting keys on).
Parameters
| Parameter | Type |
|---|---|
row | number |
column | string |
Returns
boolean
Implementation of
mapValidationError()
mapValidationError(
e,failing,duplicateText?):void
Defined in: js-api/src/ui/domains/domains-editor.ts:1289
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
| Parameter | Type |
|---|---|
e | DomainValidationError |
failing | DomainPendingOp |
duplicateText? | string |
Returns
void
markDeleted()
markDeleted(
rows):void
Defined in: js-api/src/ui/domains/domains-editor.ts:765
Marks rows deleted: they stay in the frame (order untouched) and are excluded from the filter until save removes them for real.
Parameters
| Parameter | Type |
|---|---|
rows | number | number[] |
Returns
void
markRestored()
markRestored(
rows):void
Defined in: js-api/src/ui/domains/domains-editor.ts:780
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
| Parameter | Type |
|---|---|
rows | number | number[] |
Returns
void
prepareSave()
prepareSave():
DomainPendingOp[] |null
Defined in: js-api/src/ui/domains/domains-editor.ts:1025
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:1130
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
| Parameter | Type |
|---|---|
assigned | {[draftId: string]: string; } |
Returns
void
refresh()
refresh(
query?):Promise<DataFrame>
Defined in: js-api/src/ui/domains/domains-editor.ts:1387
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
| Parameter | Type |
|---|---|
query? | DomainQuerySpec<string, string> |
Returns
Promise<DataFrame>
refusalFor()
refusalFor(
e,failing):Promise<string>
Defined in: js-api/src/ui/domains/domains-editor.ts:1311
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
| Parameter | Type |
|---|---|
e | any |
failing | DomainPendingOp |
Returns
Promise<string>
refusalOf()
refusalOf(
row,column):string|null
Defined in: js-api/src/ui/domains/domains-editor.ts:458
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 (or a key that was typed once), the row's own name where the row is; null when the cell may be edited.
Parameters
| Parameter | Type |
|---|---|
row | number |
column | string |
Returns
string | null
Implementation of
refuse()
refuse(
row,column,message):void
Defined in: js-api/src/ui/domains/domains-editor.ts:476
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
| Parameter | Type |
|---|---|
row | number |
column | string |
message | string |
Returns
void
Implementation of
resolveConflict()
resolveConflict(
e,failing):Promise<boolean>
Defined in: js-api/src/ui/domains/domains-editor.ts:1206
The 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 where the guard was one, and where the op carried an expected guard (the
external shape — its own dialog, showing what was read, what is there now and what is
pending per guard column) sends this row's changed values UNGUARDED on the retry, and on that
retry only. 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
| Parameter | Type |
|---|---|
e | DomainVersionConflictError |
failing | DomainPendingOp |
Returns
Promise<boolean>
restrictRefusal()
restrictRefusal(
e):Promise<string>
Defined in: js-api/src/ui/domains/domains-editor.ts:1337
"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
| Parameter | Type |
|---|---|
e | DomainError |
Returns
Promise<string>
revertCell()
revertCell(
row,column):void
Defined in: js-api/src/ui/domains/domains-editor.ts:791
Restores one cell to its original value and drops its change entry. Refused while a save is in flight.
Parameters
| Parameter | Type |
|---|---|
row | number |
column | string |
Returns
void
revertRow()
revertRow(
row):void
Defined in: js-api/src/ui/domains/domains-editor.ts:811
revertCell for every changed cell of [row].
Parameters
| Parameter | Type |
|---|---|
row | number |
Returns
void
save()
save():
Promise<boolean>
Defined in: js-api/src/ui/domains/domains-editor.ts:1008
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:1364
Opens/closes the editor around a transaction (see save); a DomainSession sets it on every participant. Closing is the end of the save, landed or refused: an Overwrite given during it does not outlive it.
Parameters
| Parameter | Type |
|---|---|
saving | boolean |
Returns
void
setValue()
setValue(
row,column,value):void
Defined in: js-api/src/ui/domains/domains-editor.ts:693
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
| Parameter | Type |
|---|---|
row | number |
column | string |
value | any |
Returns
void
stateOf()
stateOf(
row):DomainRowState
Defined in: js-api/src/ui/domains/domains-editor.ts:635
Editing state of [row].
Parameters
| Parameter | Type |
|---|---|
row | number |
Returns
unmarkDeleted()
unmarkDeleted(
rows):void
Defined in: js-api/src/ui/domains/domains-editor.ts:772
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
| Parameter | Type |
|---|---|
rows | number | number[] |
Returns
void
unmarkRestored()
unmarkRestored(
rows):void
Defined in: js-api/src/ui/domains/domains-editor.ts:785
Undoes markRestored: the row goes back to being a landed deletion.
Parameters
| Parameter | Type |
|---|---|
rows | number | number[] |
Returns
void
validate()
validate():
number
Defined in: js-api/src/ui/domains/domains-editor.ts:850
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:1161
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
| Parameter | Type |
|---|---|
pending | DomainPendingOp[] |
results | any[] |
Returns
Promise<void>
assignedOf()
staticassignedOf(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
| Parameter | Type |
|---|---|
pending | DomainPendingOp[] |
results | any[] |
Returns
object
attach()
staticattach(dataFrame,client,options?):Promise<DomainFrameEditor>
Defined in: js-api/src/ui/domains/domains-editor.ts:483
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
| Parameter | Type |
|---|---|
dataFrame | DataFrame |
client | DomainTableClient |
options? | DomainFrameEditorOptions |
Returns
Promise<DomainFrameEditor>
attachTo()
staticattachTo(dataFrame,schema,table,options?):Promise<DomainFrameEditor>
Defined in: js-api/src/ui/domains/domains-editor.ts:497
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
| Parameter | Type |
|---|---|
dataFrame | DataFrame |
schema | string |
table | string |
options? | DomainFrameEditorOptions |
Returns
Promise<DomainFrameEditor>
create()
staticcreate(client,options?):Promise<DomainFrameEditor>
Defined in: js-api/src/ui/domains/domains-editor.ts:505
Runs options.query (everything the caller may see, by default) and
attaches to the resulting frame.
Parameters
| Parameter | Type |
|---|---|
client | DomainTableClient |
options? | DomainFrameEditorOptions |
Returns
Promise<DomainFrameEditor>
draftId()
staticdraftId():string
Defined in: js-api/src/ui/domains/domains-editor.ts:339
Returns
string
editorsOf()
staticeditorsOf(widget):DomainFrameEditor[]
Defined in: js-api/src/ui/domains/domains-editor.ts:588
The editors [widget] answers for, or none — the duck-typed read of IEditorHost a container uses on children of any class.
Parameters
| Parameter | Type |
|---|---|
widget | any |
Returns
DomainFrameEditor[]
forContext()
staticforContext(context,options?):DomainFrameEditor
Defined in: js-api/src/ui/domains/domains-editor.ts:518
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
| Parameter | Type |
|---|---|
context | IDomainTableContext |
options? | DomainFrameEditorOptions |
Returns
DomainFrameEditor
forRows()
staticforRows(client,values,options?):Promise<DomainFrameEditor>
Defined in: js-api/src/ui/domains/domains-editor.ts:541
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
| Parameter | Type |
|---|---|
client | DomainTableClient |
values | object[] |
options? | DomainFrameEditorOptions |
Returns
Promise<DomainFrameEditor>
isDraftId()
staticisDraftId(v):boolean
Defined in: js-api/src/ui/domains/domains-editor.ts:335
Parameters
| Parameter | Type |
|---|---|
v | unknown |
Returns
boolean
isReferenceProperty()
staticisReferenceProperty(p):boolean
Defined in: js-api/src/ui/domains/domains-editor.ts:581
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
| Parameter | Type |
|---|---|
p | Property |
Returns
boolean
validateCellValue()
staticvalidateCellValue(p,value):string|null
Defined in: js-api/src/ui/domains/domains-editor.ts:560
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
| Parameter | Type |
|---|---|
p | Property |
value | any |
Returns
string | null
writableColumns()
staticwritableColumns(access,options?):string[]
Defined in: js-api/src/ui/domains/domains-editor.ts:417
The columns [access] lets the caller write, in the server's (declared) order: the
editable ones, plus under options.draft the immutable ones — the key of an external
table, typed once on insert and never patched.
Parameters
| Parameter | Type |
|---|---|
access | DomainAccess |
options? | { draft?: boolean; } |
options.draft? | boolean |
Returns
string[]