FormContext
@firecms/core / FormContext
Interface: FormContext<M>
Section titled “Interface: FormContext<M>”Defined in: types/fields.tsx:130
Context passed to custom fields
Type Parameters
Section titled “Type Parameters”M extends Record<string, any> = any
Properties
Section titled “Properties”collection?
Section titled “collection?”
optionalcollection:ResolvedEntityCollection<M>
Defined in: types/fields.tsx:153
Collection of the entity being modified
disabled
Section titled “disabled”disabled:
boolean
Defined in: types/fields.tsx:180
entity?
Section titled “entity?”
optionalentity:Entity<M>
Defined in: types/fields.tsx:167
entityId
Section titled “entityId”entityId:
string
Defined in: types/fields.tsx:158
Entity id, it can be null if it’s a new entity
formex
Section titled “formex”formex:
FormexController<M>
Defined in: types/fields.tsx:178
This is the underlying formex controller that powers the form. If you are in a red only mode, the formex controller is there, but you can’t operate with it
openEntityMode
Section titled “openEntityMode”openEntityMode:
"side_panel"|"full_screen"
Defined in: types/fields.tsx:171
optionalpath:string
Defined in: types/fields.tsx:163
Path this entity is located at
save()
Section titled “save()”save: (
values) =>void
Defined in: types/fields.tsx:148
Save the entity.
Parameters
Section titled “Parameters”values
Section titled “values”M
Returns
Section titled “Returns”void
savingError?
Section titled “savingError?”
optionalsavingError:Error
Defined in: types/fields.tsx:169
setFieldValue()
Section titled “setFieldValue()”setFieldValue: (
key,value,shouldValidate?) =>void
Defined in: types/fields.tsx:143
Update the value of a field
Parameters
Section titled “Parameters”string
any
shouldValidate?
Section titled “shouldValidate?”boolean
Returns
Section titled “Returns”void
status
Section titled “status”status:
"copy"|"new"|"existing"
Defined in: types/fields.tsx:165
values
Section titled “values”values:
M
Defined in: types/fields.tsx:135
Current values of the entity