Skip to main content

IListFormConfig

@spartanfx/react v1.2.2


@spartanfx/react / spfx / IListFormConfig

Interface: IListFormConfig

Configuration object for initializing the ListForm context.

This configuration controls how the form is initialized, including list metadata, SPFx context, behavior flags, and lifecycle hooks.

Properties

Required

PropertyTypeDescription
listNamestringThe display name of the SharePoint list.
spSPFIPnPjs SPFI instance used for SharePoint REST API operations.
webPartContextWebPartContextSPFx WebPart context, typically passed from the WebPart class.

Options

PropertyTypeDescription
disabled?booleanIf true, disables all controls in the form. The context's disabled flag will reflect this.
itemId?numberID of the SharePoint list item to load into the form. Optional render the form in "new item" mode if null or undefined.
readonly?booleanIf true, renders the form in readonly mode (visually editable, but no actions are allowed). Unlike disabled, fields are not grayed out and can still be visually interacted with.

Events & callbacks

PropertyTypeDescription
onInit?(listFormContext) => void | Promise<void>Lifecycle hook called once before the form is shown. Use this to pre-fill form state or run initialization logic. If a Promise is returned, rendering will be delayed until the Promise resolves.
translate?(text) => stringOptional translation function for localizing UI text strings. If not provided, raw text values will be used.