Skip to main content

TypeAheadCallbackSource

TypeAheadCallbackSource = (query) => Promise<(string | Dictionary)[]>

Defined in: js-api/src/widgets/types.ts:28

Async suggestion callback for TypeAheadConfig.source: receives the typed query and resolves to suggestions — strings or objects with a label (extra fields ride along and are passed to onSubmit intact, e.g. {label, value} for lookups resolving to an id).

The callback path is a self-contained dropdown, not typeahead-standalone: of the TypeAheadConfig keys it honors only minLength, limit, debounceRemote, and onSubmit; display, templates, highlight, hint, autoSelect, diacritics, preventSubmit, and the other standalone options are ignored.

Parameters

ParameterType
querystring

Returns

Promise<(string | Dictionary)[]>