interface
PluginForm
Read the containing document form, or connect to another field to update it.
Properties
| Property | Type | Description |
|---|---|---|
bind | (path: string) => PluginFieldBinding< | Connect to another field in this document's unsaved form.
Paths start at the document root: "title", "seo.description", or
"reviews.0.note". The last example selects the first review **now**. Keep
the returned binding: it follows that same row if the user reorders reviews.
Calling bind("reviews.0.note") later would select the row at index 0 then.
Create the binding before starting a request, timer or other delayed work.
Ridu disables it if the target disappears or the source editor closes, and
also when the document, locale, schema or saved/reset form values change.
Later reads and writes throw instead of editing a different field or document.
The target must be editable, and the source editor must be editable too.
The returned value type is unknown: a string path does not prove a field's
TypeScript type. Check read values and supply the target field's expected shape.
bind itself throws if the path has no identifiable field. Repeated rows
currently require nonempty, unique _key values. |
contentLocale | string | The content locale being edited, such as "fr"; separate from the admin UI language. |
resource | FieldFormResource | Which collection document or global is being edited, when supplied by this form. |
get | (path: string) => unknown | Read a copy of a value by its current document-root path, such as "title"
or "reviews.0.note". Returns undefined for a missing value. A numbered path
reads whichever row is at that position now; it does not remember row identity.
Check the returned value's type before using it. |
issuesFor | (path: string) => readonly ValidationIssue[] | Current validation issues at or below a document-root path, including server issues. |
snapshot | () => Record< | Copy all current form values, including unsaved edits. The result is a snapshot: it does not update when the user types, and changing it does not update the form. This is form data, not a fresh document fetched from the server. |
Full signature
interface PluginForm { ... }Methods
PluginForm.bind()Connect to another field in this document's unsaved form.
PluginForm.get()Read a copy of a value by its current document-root path, such as
"title"or"reviews.0.note". Returns undefined for a missing value. A numbered path reads whichever row is at that position now; it does not remember row identity. Check the returned value's type before using it.PluginForm.issuesFor()Current validation issues at or below a document-root path, including server issues.
PluginForm.snapshot()Copy all current form values, including unsaved edits. The result is a snapshot: it does not update when the user types, and changing it does not update the form. This is form data, not a fresh document fetched from the server.