All Components

ComboBoxComponent

Represents the Kendo UI ComboBox component for Angular.

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

Selector

kendo-combobox

Accessible in templates as #kendoComboBoxInstance="kendoComboBox"

Inputs

allowCustom boolean

Specifies whether the ComboBox allows user-defined values that are not present in the dataset.
The default value is false.

For more information, refer to the section on custom values.

clearButton boolean

Unless this options is set to false, a button will appear when hovering over the component. Clicking that button resets the component value to undefined and triggers the change event.

disabled boolean

Sets the disabled state of the component.

filterable boolean

Enables the filtering functionality. If set to true, the component emits the filterChange event.

loading boolean

Sets and gets the loading state of the ComboBox.

placeholder string

The hint displayed when the component is empty.

tabIndex number

Specifies the tabIndex of the component.

textField string

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

valueField string

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

valuePrimitive boolean

Specifies the type of the selected value. If set to true, the selected value has to be of the primitive type.

For more details, refer to the section on the valuePrimitive property.

data any

Sets the data of the ComboBox.

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

popupSettings PopupSettings

Configures the popup of the ComboBox.

The available options are:

  • animation: 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, so no item labels are wrapped.
  • height: Number—Sets the height of the popup container. By default, the height is 200px.
  • popupClass: String—Specifies a list of CSS classes that are used to style the popup.

value any

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

Selected values that are not present in the dataset are considered custom values. Unless allowCustom is set to true, custom values are dismissed when "enter" key is pressed or after the component looses focus.

valueNormalizer (text: Observable) => Observable

A user-defined callback returning normalized custom values. Typically used when the data items are not of type string.

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

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.map((text: string) => {
     return { ProductID: null, ProductName: text };
  });

}

Fields

isOpen boolean

Returns the current open state of the popup.

Events

close EventEmitter

Fires each time the popup is about to close.
This event is preventable. If you cancel the event, the popup will remain opened.

filterChange EventEmitter

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

For more details, refer to the section on the filterChange event.

blur EventEmitter

Fires each time the AutoComplete component gets blurred.

focus EventEmitter

Fires each time the user focuses the AutoComplete component.

open EventEmitter

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

selectionChange EventEmitter

Fires each time an item selection is changed.

For more details, refer to the section on the selectionChange event.

valueChange EventEmitter

Fires each time the value is changed.

For more details, refer to the section on the valueChange event.

Methods

blur

Blurs the ComboBox component.

focus

Focuses the ComboBox component.

toggle

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

Parameters

open boolean

The state of the popup.

In this article