Skip to main content

IListFormFieldCascadingLookupProps

@spartanfx/react v1.2.2


@spartanfx/react / spfx / IListFormFieldCascadingLookupProps

Interface: IListFormFieldCascadingLookupProps

Props for the ListFormCascadingLookup component.

This component renders a dynamic, optionally searchable, cascading lookup field in a SharePoint list form, supporting multi-select, filtering, and value constraints.

Extends

Properties

Required

PropertyTypeDescription
fieldIFieldInfoThe SharePoint field definition object.
formStateKeystringThe key used in the form state object, matching the field's internal name.
listFormContextIListFormContextThe full list form context for accessing state, validation, etc.

Options

PropertyTypeDescription
allowedValues?string[]If provided, restricts lookup options to items containing these allowed string values.
canSelectAll?booleanEnables a "Select All" checkbox in multi-select mode.
cascadingFieldInternalName?stringInternal name of the field this lookup cascades from. Used to filter lookup results.
disabled?booleanWhether the field is disabled. Overrides form-level settings.
inlineLabel?booleanDisplays the label inline with the dropdown.
labelWidth?stringCustom width to apply to the label, useful when inlineLabel is true.
lookupFieldInternalName?stringInternal name of the lookup field to use for cascading filtering (e.g., the lookup target's field).
maxOptions?numberMaximum number of options to show without search; a notice is shown when limit is exceeded.
maxSelection?numberMaximum number of items that can be selected in multi-select mode. If not set, allows unlimited selection.
options?any[]Optional custom options to be used instead of querying the list.
optionTextField?stringField name to use for option text display, instead of the SharePoint field's LookupField. Useful when LookupField may return null (e.g. calculated field returning null for inactive items). When set and different from LookupField, it is added to the CAML View automatically.
readonly?booleanIf true, renders the field in readonly mode without user interaction.
renderDisabledOptions?booleanWhen true, options flagged by isOptionDisabled are rendered in the dropdown with disabled styling. Default: false (filter them out).
required?booleanWhether the field is required.
restrictFields?string[]Restrict the CAML View fields returned by SharePoint to this list (plus the essentials: Id, the SP LookupField, and optionTextField if set — auto-merged so the component cannot break itself). Useful to access extra row data in isOptionDisabled or downstream consumers. When not provided, no ViewFields are passed, so SharePoint returns all properties of the item.
withSearch?booleanEnables a search box above the dropdown options for filtering.

Events & callbacks

PropertyTypeDescription
isOptionDisabled?(option) => booleanPredicate to mark options as disabled, receives the raw row data. Disabled options behavior depends on renderDisabledOptions: - false (default): disabled options are filtered out, EXCEPT currently selected ones (kept so the field value stays visible). - true: disabled options are shown with disabled styling, EXCEPT currently selected ones (kept enabled so they can be deselected).
onChange?(newValue, oldValue?) => voidOptional callback triggered when the field value changes.
translate?(text) => string-

Advanced & escape hatches

PropertyTypeDescription
controlProps?anyProps passed directly to the underlying field control.