ComboBoxComponent
Represents the Kendo UI ComboBox component for Angular.
Definition
Package:@progress/kendo-angular-dropdowns
Selector:kendo-combobox
Export Name:Accessible in templates as #kendoComboBoxInstance="kendoComboBox"
Syntax:
<kendo-combobox [data]="listItems"> </kendo-combobox>
Inputs
Enables or disables the adaptive mode. By default, adaptive rendering is disabled.
'none'
adaptiveSubtitle
string
Sets the subtitle of the ActionSheet that is rendered instead of the Popup when using small screen devices. By default, the ActionSheet does not render a subtitle.
adaptiveTitle
string
Sets the title of the ActionSheet that is rendered instead of the Popup when using small screen devices. By default, the ActionSheet title uses the text provided for the label of the ComboBox.
''
allowCustom
boolean
Specifies whether the ComboBox allows user-defined values that are not present in the dataset
(more information and examples).
Defaults to false.
The feature is not available when using adaptive mode.
false
clearButton
boolean
If set to true, renders a button on hovering over the component.
Clicking this button resets the value of the component to undefined and triggers the change event.
true
data
any
Sets the data of the ComboBox. The data must be provided in an array-like list.
disabled
boolean
Sets the disabled state of the component. To learn how to disable the component in reactive forms, refer to the articles on ComboBox Forms Support and MultiColumnComboBox Forms Support.
false
Sets the fillMode of the component. The default value is set by the Kendo theme.
filterable
boolean
Enables the filtering functionality.
If set to true, the component emits the filterChange event.
false
inputAttributes
{ [key: string]: string }
Sets the HTML attributes of the inner focusable input element. Attributes essential for certain component functionalities cannot be changed.
Defines a Boolean function that is executed for each data item in the component (see examples). Determines whether the item is disabled.
listHeight
number
Sets the height of the options list in the popup. By default, listHeight is 200px.
The
listHeightproperty affects only the list of options and not the whole popup container. To set the height of the popup container, usepopupSettings.height.
When using adaptiveMode and the screen size is small or medium the listHeight property is set to null.
loading
boolean
Sets and gets the loading state of the ComboBox.
placeholder
string
The hint that is displayed when the component is empty.
""
Configures the popup of the ComboBox.
readonly
boolean
Sets the read-only state of the component.
false
Sets the border radius of the component. The default value is set by the Kendo theme.
showStickyHeader
boolean
Shows or hides the current group sticky header when using grouped data. By default the sticky header is displayed (see example).
true
Sets the size of the component. The default value is set by the Kendo theme.
suggest
boolean
Enables the auto-completion of the text based on the first data item.
false
textField
string
Sets the data item field that represents the item text. If the data contains only primitive values, do not define this property.
The textField property can be set to a nested property value, for example, category.name.
value
any
Sets the value of the ComboBox. The value can be a primitive (string, number) or a complex object. Use the valuePrimitive property to define the type.
All selected values not present in the dataset are custom values. When the Enter key is pressed or the component loses focus, custom values are dismissed unless allowCustom is set to true.
valueField
string
Sets the data item field that represents the item value. If the data contains only primitive values, do not define it.
The
valueFieldproperty can be set to point to a nested property value - e.g.category.id.
A user-defined callback which returns normalized custom values.
Typically used when the data items are different from type string.
Observable<any>
valuePrimitive
boolean
Specifies the type of the selected value. If set to true, the selected value must be a primitive type.
(more information and example)
virtual
boolean | VirtualizationSettings
Enables the virtualization functionality.
Fields
isOpen
boolean
Returns the current open state. Returns true if the popup or actionSheet is open.
Events
blur
EventEmitter<any>
Fires each time the ComboBox gets blurred.
close
EventEmitter<PreventableEvent>
Fires each time the popup is about to close. This event is preventable. If you cancel it, the popup remains open.
closed
EventEmitter<any>
Fires after the popup has been closed.
filterChange
EventEmitter<any>
Fires each time the user types in the input field. You can filter the source based on the passed filtration value (see example).
focus
EventEmitter<any>
Fires each time the user focuses the ComboBox.
inputBlur
EventEmitter<any>
Fires each time the input element gets blurred.
inputFocus
EventEmitter<any>
Fires each time the user focuses the input element.
open
EventEmitter<PreventableEvent>
Fires each time the popup is about to open. This event is preventable. If you cancel it, the popup remains closed.
opened
EventEmitter<any>
Fires after the popup has been opened.
Fires each time an item selection is changed (see example).
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
Blurs the ComboBox.
Focuses the ComboBox.
Focuses a specific item of the ComboBox based on a provided index. If null or invalid index is provided the focus will be removed.
Resets the value of the ComboBox.
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.
Toggles the visibility of the popup or actionSheet. If you use the toggle method to open or close the popup or actionSheet,
the open and close events will not be fired.
The state of the popup.