IListFormContext
3p-core / IListFormContext
Interface: IListFormContext
Describes the complete context of a SharePoint list form within an SPFx web part.
This includes field metadata, form state, validation, attachments, and access to the underlying SPFx and PnPjs services.
Properties
Property | Type | Description |
---|---|---|
attachments | IFormAttachments | Attachments manager |
disabled | boolean | Indicates if the form controls are disabled |
fields | IFieldInfo [] | Metadata for fields available on the list |
formState | IFormState | State manager for field values in the form |
getField | (fieldInternalName ) => IFieldInfo | Retrieves full field metadata for a given internal field name. |
getFieldDefaultValue | (fieldInternalname ) => any | Gets the default value for a specified field. |
getListItemFromFormState | <T >() => Promise <T > | Converts the form state into a SharePoint-compatible list item object. Useful before saving to the list. |
getText | (text ) => string | Retrieves a localized or resource string if available. |
initialized | boolean | Indicates if the form is fully initialized (fields loaded, etc.) |
isNewForm | boolean | True if the current form is for creating a new list item |
itemId | number | The ID of the current list item |
list | IListInfo | Metadata for the SharePoint list |
listItem | any | Raw SharePoint list item data |
readonly | boolean | Indicates if the form is in read-only mode |
saveListItem | (listItem , forceOverride? , folderPath? ) => Promise <IListItem > | Persists the list item to SharePoint. |
sp | SPFI | PnP.js SPFI instance scoped to the list/web |
validation | IFormValidation | Field-level validation state |
webPartContext | WebPartContext | The SPFx web part context, typically passed from the host component |