Skip to content

WidgetCombobox

Overview

A combobox widget supporting static options or API-backed search, single or multiple selection, grouping, and read-only display. Replaces WidgetSearchableSelect, WidgetAutoComplete, and WidgetMultiSelect.

Provide either options (static mode) or both app and model (API mode). The multiple prop works in both modes.

Theme entry: WidgetCombobox

Props

NameTypeRequiredDefaultDescription
iconOverrideObjectnullA partial icon registry ({ [componentName]: { [iconName]: { component, props } } }) merged with inherited and default icon entries; scopes icon overrides to this component and its descendants.
themeOverrideString|Object|ArraynullA partial theme object merged with the component's default theme; accepts a class string, class array, or theme object.
nameStringundefinedThe widget name; falls back to the field context value when omitted.
labelStringundefinedThe label displayed next to the widget; falls back to the field context value when omitted.
helpStringundefinedHelp text displayed alongside the widget; falls back to the field context value when omitted.
readOnlyBooleanfalseWhether the widget is read-only; falls back to the field context value when omitted.
requiredBooleanundefined, // let the default from field context take overWhether the widget is required; falls back to the field context value when undefined.
modelValueString|Number|Boolean|Array|ObjectundefinedThe widget's bound value (v-model); used only in contextless mode.
fieldToWidgetObject|FunctionnullAdapter that converts the form model value into a value suitable for the widget UI.
widgetToFieldObject|FunctionnullAdapter that converts the widget UI value back into a form model value for validation and submission.
invalidBooleanundefinedManually set the invalid state when not in a field context.
warningBooleanundefinedManually set the warning state when not in a field context.
disabledBooleanfalseWhether the widget is disabled.
disabledFnFunctionnullA function that returns whether the widget should be disabled; takes precedence over the disabled prop.
contextlessBooleanfalseWhen true, the widget ignores any surrounding field or form context and manages its own state.
displayDependenciesArray() => []Field paths whose values the widget needs for display logic; registered with the field context.
optionsarrayundefinedStatic option array. When provided, filtering is handled client-side via useFilter.
appstringundefinedDjango app label for the model to search (API mode).
modelstringundefinedDjango model name (API mode).
modelFieldsarray[]Additional field names to include in each API result (API mode).
modelExpandFieldsarray[]Field names to expand in each API result (API mode).
modelOrderingarray[]Default ordering for API results (API mode).
multiplebooleanfalseWhether multiple values can be selected.
optionLabelstring"formatted_name"Field name on each option object to use as the displayed label in the search list.
optionValuestring"value"Field name on each option object to use as the submitted value (static mode).
selectedOptionLabelstring"formatted_name"Field name on each resolved object to display when the combobox is closed (API mode).
readonlybooleanfalseWhether the widget is in read-only mode.
placeholderstringundefinedPlaceholder text shown when no value is selected.
extraParamsobject{}Extra query parameters merged into every API request (API mode).
getExtraParamsfuncundefinedFunction returning additional parameters from field dependency values (API mode).
groupedbooleanfalseWhether to group API results by a field (API mode).
groupBystringundefinedField name to group results by (API mode). Requires grouped: true.

Events

NameDescription
update:modelValueEmitted when the widget value changes.

Full event reference

Source

client/lib/widgets/WidgetCombobox.vue

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2