useComboboxSearch
Overview
Manages reactive state and API data-fetching for a combobox widget backed by a vueda model endpoint. Only call this composable when app and model props are present.
Signature
useComboboxSearch(props, widgetContext)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| props | object | yes | Component props containing app, model, and search configuration. |
| widgetContext | WidgetContext | yes | The widget context. |
props Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| app | string | Django app label for the model to search. | ||
| extraParams | object | Extra query parameters merged into every API request. | ||
| getExtraParams | Function | Function returning additional parameters from dependency values. | ||
| groupBy | string | Field name to group options by. Requires grouped: true. | ||
| grouped | boolean | Whether to group options by a field. | ||
| model | string | Django model name. | ||
| modelExpandFields | string[] | Fields to expand in the fetch. | ||
| modelFields | string[] | Additional fields to fetch alongside the label and PK. | ||
| modelOrdering | string[] | Default ordering for the list. | ||
| optionLabel | string | Field name to display as the option label in the search list. | ||
| placeholder | string | Placeholder text. | ||
| selectedOptionLabel | string | Field name for the closed-state display label. |
Returns
Reactive search state.
Source
client/lib/use/useComboboxSearch.js:94