Skip to main content

MultiSearch

MultiSearch widgetMultiSearch widget

A multi-select whose filter query shows as a search line. Typing fuzzy-matches and ranks the options with the matched characters highlighted; Space toggles. It collects a list<string> of the checked values.

$p->multiSearch('basket', 'Basket')
->options([
'apple' => 'Apple',
'banana' => 'Banana',
'carrot' => 'Carrot',
'tomato' => 'Tomato',
])
->default(['apple']) // Values pre-checked when the field opens.
->pageSize(10); // Matches visible before the list pages around the cursor.

Options

NameDescriptionRequiredDefault
options()The choices, as a value => label map (or added one at a time with option()).Yes-
default()Values pre-checked when the field opens.No[] (none)
pageSize()Matches shown before the list pages around the cursor.No10

For headings, separators and disabled options, see Option groups.

Keyboard

KeyAction
printable keysType to fuzzy-filter and rank the options
/ Move over the matches
SpaceToggle the highlighted match
/ Select all / deselect all visible
BackspaceDelete a filter character
EnterAccept the checked set
EscCancel

Display modes

In all four display modes - Unicode or ASCII, colour on or off:

ANSINo ANSI
UnicodeMultiSearch: Unicode + ANSIMultiSearch: Unicode + ANSIMultiSearch: Unicode + No ANSIMultiSearch: Unicode + No ANSI
ASCIIMultiSearch: ASCII + ANSIMultiSearch: ASCII + ANSIMultiSearch: ASCII + No ANSIMultiSearch: ASCII + No ANSI