Skip to content

Multiselect editor ​

cellEditor: 'multiselect' picks several items in one cell. It suits tags or permissions. The input shows the picked labels joined by ", ", and the list turns each item on or off with a check box.

ts
{ id: 'tags', editable: true, cellEditor: 'multiselect',
  editorOptions: [{ value: 'a', label: 'Urgent' }, { value: 'b', label: 'Review' }],
  editorParams: { selectAll: true } }

It needs the optional editors bundle (maxgrid/editors in the modular build). Without the bundle, creating the grid fails with invalid-option. The list comes from the same sources as the Combobox editor: a fixed array, a per-row function or optionsFrom. An empty list keeps the editor closed.

Options ​

All go in editorParams. Defaults apply when omitted.

OptionValueDefaultEffect
separatorstring of 1-3 chars','Separator of the string mode, and of items in copy, paste and export
selectAllbooleanfalsePuts a "Select all" row at the top; hidden while the list is filtered
valueAs'array' · 'string''array'Value shape; string stores the values joined by the separator
maxHeightinteger 80-600 (px)240Maximum list height
noResultsTextstringper languageText shown when the filter matches nothing

Common input attributes such as placeholder work as usual. An unknown key or a wrong value fails at creation with invalid-option.

Value ​

CaseValue
Default (array)Array of the picked values, in option order, not click order
valueAs: 'string'Picked values joined by the separator ('a;c'); read back by splitting and trimming
Nothing picked[] for arrays, '' for strings, null when the column has emptyAs: 'null'
Stored value not in listNot switched on in the list; dropped when committed

Array values are compared deeply, so only real changes are recorded: a new array with the same content is not a change, and undo restores the previous array.

Keyboard ​

InputAction
↓ · ↑Opens a closed list; moves the active item in an open list
Home · EndJumps to the first or last item while the list is open
SpaceToggles the active item; without an active item it types a space
TypingFilters the list by the item text
EnterCommits the whole selection
EscCloses an open list and restores the input text; a second press cancels the edit

The list is role="listbox" with aria-multiselectable="true", and picked items have aria-selected="true". The active item is exposed by aria-activedescendant. On a narrow screen the list opens as a bottom sheet like the combobox, and pressing an item does not close it.

Display, copy, export and filter ​

FeatureBehavior
DisplayPicked labels joined by ", "; a label comes from optionLabel, a fixed editorOptions label, then the value
Copy and exportThe same labels joined by the separator; formatValue wins when present
PasteSplits by the separator and matches an item label or value; unknown pieces are dropped, and a cell where nothing matches is skipped
Sort, quick filterUse the displayed text
Filter list, conditionsThe list shows each item; in and equals pass when any element matches, notEquals and notContains only when none does

A function-valued editorOptions has no labels the display can know, so give such a column an optionLabel too.

See also ​