• Components
    • Barcodes
    • Buttons
    • Charts
    • Conversational UI
    • Data Query
    • Date Inputsupdated
    • Date Math
    • Dialogsupdated
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Filterupdated
    • Ganttupdated
    • Gauges
    • Gridupdated
    • Icons
    • Indicatorsupdated
    • Inputsupdated
    • Labels
    • Layoutupdated
    • ListBox
    • ListView
    • Mapbeta
    • Menus
    • Navigationupdated
    • Notification
    • Pager
    • PDF Export
    • PivotGridupdated
    • Popup
    • ProgressBarsupdated
    • Ripple
    • Schedulerupdated
    • ScrollView
    • Sortable
    • ToolBar
    • Tooltips
    • TreeList
    • TreeViewupdated
    • Typography
    • Uploads
    • Utilitiesnew
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Sample Applications
  • FAQ
  • Troubleshooting
New to Kendo UI for Angular? Start a free 30-day trial

MultiSelectComponent

Represents the Kendo UI MultiSelect component for Angular.

@Component({
selector: 'my-app',
template: `
 <kendo-multiselect [data]="listItems">
 </kendo-multiselect>
`
})
class AppComponent {
  public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
}

Selector

kendo-multiselect

Export Name

Accessible in templates as #kendoMultiSelectInstance="kendoMultiSelect"

Inputs

NameTypeDefaultDescription

allowCustom

boolean

Specifies whether the MultiSelect allows user-defined values that are not present in the dataset (more information and examples). Defaults to false.

autoClose

boolean

true

Determines whether to close the options list of the MultiSelect after the item selection is finished (see example).

checkboxes

boolean | MultiSelectCheckableSettings

Specifies whether checkboxes will be rendered before each item in the popup list.

clearButton

boolean

If set to true, renders a button on hovering over the component. Clicking this button resets the value of the component to an empty array and triggers the change event.

data

any[]

Sets the data of the MultiSelect.

The data has to be provided in an array-like list of items.

disabled

boolean

Sets the disabled state of the component.

fillMode

DropDownFillMode

Sets the fillMode of the component.

The possible values are:

  • flat
  • solid (default)
  • outline
  • none

filterable

boolean

Enables the filtering functionality of the MultiSelect.

itemDisabled

ItemDisabledFn

Defines a Boolean function that is executed for each data item in the component (see examples). Determines whether the item will be disabled.

listHeight

number

Sets the height of the suggestions list. By default, listHeight is 200px.

The listHeight property affects only the list of suggestions and not the whole popup container. To set the height of the popup container, use popupSettings.height.

loading

boolean

Sets and gets the loading state of the MultiSelect.

placeholder

string

The hint which is displayed when the component is empty. When the values are selected, it disappears.

popupSettings

PopupSettings

Configures the popup of the MultiSelect.

The available options are:

  • animate: Boolean—Controls the popup animation. By default, the open and close animations are enabled.
  • width: Number | String—Sets the width of the popup container. By default, the width of the host element is used. If set to auto, the component automatically adjusts the width of the popup and no item labels are wrapped. The auto mode is not supported when virtual scrolling is enabled.
  • height: Number—Sets the height of the popup container.
  • popupClass: String—Specifies a list of CSS classes that are used to style the popup.
  • appendTo: "root" | "component" | ViewContainerRef—Specifies the component to which the popup will be appended.

readonly

boolean

Sets the read-only state of the component.

rounded

DropDownRounded

Sets the border radius of the component.

The possible values are:

  • small
  • medium (default)
  • large
  • full
  • none

size

DropDownSize

Sets the size of the component.

The possible values are:

  • small
  • medium (default)
  • large
  • none

tabindex

number

Specifies the tabindex of the component.

tagMapper

(tags: any) => any

A user-defined callback function which receives an array of selected data items and maps them to an array of tags (see examples).

textField

string

Sets the data item field that represents the item text. If the data contains only primitive values, do not define it.

The textField property can be set to point to a nested property value - e.g. category.name.

value

any[]

Sets the value of the MultiSelect. It can be either of the primitive (string, numbers) or of the complex (objects) type. To define the type, use the valuePrimitive option.

All selected values which are not present in the source are ignored.

valueField

string

Sets the data item field that represents the item value. If the data contains only primitive values, do not define it.

The valueField property can be set to point to a nested property value - e.g. category.id.

valueNormalizer

(text: Observable<string>) => Observable<any>

A user-defined callback function which returns normalized custom values. Typically used when the data items are different from type string.

import { map } from 'rxjs/operators';

@Component({
selector: 'my-app',
template: `
  <kendo-multiselect
      [allowCustom]="true"
      [data]="listItems"
      textField="text"
      valueField="value"
      [valueNormalizer]="valueNormalizer"
      (valueChange)="onValueChange($event)"
  >
  </kendo-multiselect>
`
})

class AppComponent {
  public listItems: Array<{ text: string, value: number }> = [
      { text: "Small", value: 1 },
      { text: "Medium", value: 2 },
      { text: "Large", value: 3 }
  ];

  public onValueChange(value) {
      console.log("valueChange : ", value);
  }

  public valueNormalizer = (text$: Observable<string>) => text$.pipe(map((text: string) => {
     return {
        value: Math.floor(Math.random() * (1000 - 100) + 1000), //generate unique valueField
        text: text };
  }));

}

valuePrimitive

boolean

Specifies the type of the selected value. If set to true, the selected value has to be of the primitive type (more information and example).

virtual

boolean | VirtualizationSettings

Enables the virtualization functionality.

Fields

NameTypeDefaultDescription

isOpen

boolean

Returns the current open state of the popup.

Events

NameTypeDescription

close

EventEmitter<PreventableEvent>

Fires each time the popup is about to close (see example). This event is preventable. If you cancel it, the popup will remain open.

closed

EventEmitter<any>

Fires after the popup has been closed.

filterChange

EventEmitter<string>

Fires each time the user types in the input field. You can filter the source based on the passed filtration value.

blur

EventEmitter<any>

Fires each time the MultiSelect gets blurred.

focus

EventEmitter<any>

Fires each time the user focuses the MultiSelect.

open

EventEmitter<PreventableEvent>

Fires each time the popup is about to open (see example). This event is preventable. If you cancel it, the popup will remain closed.

opened

EventEmitter<any>

Fires after the popup has been opened.

removeTag

EventEmitter<RemoveTagEvent>

Fires each time a tag is about to be removed(see examples). This event is preventable. If you cancel it, the tag will not be removed.

valueChange

EventEmitter<any[]>

Fires each time the value is changed— when the component is blurred or the value is cleared through the Clear button (see example). When the value of the component is programmatically changed to ngModel or formControl through its API or form binding, the valueChange event is not triggered because it might cause a mix-up with the built-in valueChange mechanisms of the ngModel or formControl bindings.

Methods

blur

Blurs the MultiSelect.

focus

Focuses the MultiSelect.

focusItemAt

Focuses a specific item of the MultiSelect based on a provided index. If there is a custom item it is positioned at index -1. If null or invalid index is provided the focus will be removed.

Parameters

index

number

reset

Resets the value of the MultiSelect. If you use the reset method to clear the value of the component, the model will not update automatically and the selectionChange and valueChange events will not be fired.

toggle

Toggles the visibility of the popup (see example). If you use the toggle method to open or close the popup, the respective open and close events will not be fired.

Parameters

open?

boolean

The state of the popup.