Represents a drop-down list that provides editable functionalities, allowing users to choose an option from a predefined list.
- Igx Module
- IgxComboModule
- Igx Theme
- igx-combo-theme
- Igx Keywords
- combobox, combo selection
- Igx Group
- Grids & Lists
Remarks
Example
<igx-combo [itemsMaxHeight]="250" [data]="locationData"
[displayKey]="'field'" [valueKey]="'field'"
placeholder="Location(s)" searchPlaceholder="Search...">
</igx-combo> Constructors
Section titled "Constructors"IgxComboComponent
new IgxComboComponent(): IgxComboComponent Defined in projects/igniteui-angular/combo/src/combo/combo.component.ts:187
Returns IgxComboComponent
Properties
Section titled "Properties"addItemTemplate
Section titled "addItemTemplate"Inherited from: IgxComboBaseDirective
The custom template, if any, that should be used when rendering the ADD BUTTON in the combo drop down
// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.addItemTemplate = myCustomTemplate;<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboAddItem>
<button type="button" igxButton="contained" class="combo__add-button">
Click to add item
</button>
</ng-template>
</igx-combo> addItemTemplate: TemplateRef<any> = null Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:687
addition
Section titled "addition"Inherited from: IgxComboBaseDirective
Emitted when an item is being added to the data collection
<igx-combo (addition)='handleAdditionEvent($event)'></igx-combo> addition: EventEmitter<IComboItemAdditionEvent> Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:553
allowCustomValues
Section titled "allowCustomValues"Inherited from: IgxComboBaseDirective
Controls whether custom values can be added to the collection
// get
let comboAllowsCustomValues = this.combo.allowCustomValues;<!--set-->
<igx-combo [allowCustomValues]='true'></igx-combo> allowCustomValues: boolean = false Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:230
ariaLabelledBy
Section titled "ariaLabelledBy"Inherited from: IgxComboBaseDirective
Sets aria-labelledby attribute value.
<igx-combo [ariaLabelledBy]="'label1'"> ariaLabelledBy: string Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:444
autoFocusSearch
Section titled "autoFocusSearch"Whether the combo's search box should be focused after the dropdown is opened.
When false, the combo's list item container will be focused instead
autoFocusSearch: boolean = true Defined in projects/igniteui-angular/combo/src/combo/combo.component.ts:129
clearIconTemplate
Section titled "clearIconTemplate"Inherited from: IgxComboBaseDirective
The custom template, if any, that should be used when rendering the combo CLEAR button
// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.clearIconTemplate = myCustomTemplate;<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboClearIcon>
<igx-icon>clear</igx-icon>
</ng-template>
</igx-combo> clearIconTemplate: TemplateRef<any> = null Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:752
closed
Section titled "closed"Inherited from: IgxComboBaseDirective
Emitted after the dropdown is closed
<igx-combo (closed)='handleClosed($event)'></igx-combo> closed: EventEmitter<IBaseEventArgs> Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:543
closing
Section titled "closing"Inherited from: IgxComboBaseDirective
Emitted before the dropdown is closed
<igx-combo (closing)='handleClosing($event)'></igx-combo> closing: EventEmitter<IBaseCancelableBrowserEventArgs> Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:533
dataPreLoad
Section titled "dataPreLoad"Inherited from: IgxComboBaseDirective
Emitted when new chunk of data is loaded from the virtualization
<igx-combo (dataPreLoad)='handleDataPreloadEvent($event)'></igx-combo> dataPreLoad: EventEmitter<IForOfState> Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:573
disableClear
Section titled "disableClear"Inherited from: IgxComboBaseDirective
Disables the clear button. The default is false.
// get
let myComboDisableClear = this.combo.disableClear;<!--set-->
<igx-combo [disableClear]="true"></igx-combo> disableClear: boolean = false Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:473
disabled
Section titled "disabled"Inherited from: IgxComboBaseDirective
Disables the combo. The default is false.
<igx-combo [disabled]="'true'"> disabled: boolean = false Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:457
document
Section titled "document"Inherited from: IgxComboBaseDirective
document: Document Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:117
emptyTemplate
Section titled "emptyTemplate"Inherited from: IgxComboBaseDirective
The custom template, if any, that should be used when rendering the ADD BUTTON in the combo drop down
// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.emptyTemplate = myCustomTemplate;<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboEmpty>
<div class="combo--empty">
There are no items to display
</div>
</ng-template>
</igx-combo> emptyTemplate: TemplateRef<any> = null Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:710
filterFunction
Section titled "filterFunction"Inherited from: IgxComboBaseDirective
Gets/Sets the custom filtering function of the combo.
filterFunction: object Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:435
Example
<igx-comb #combo [data]="localData" [filterFunction]="filterFunction"></igx-combo> footerTemplate
Section titled "footerTemplate"Inherited from: IgxComboBaseDirective
The custom template, if any, that should be used when rendering the FOOTER for the combo items list
// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.footerTemplate = myCustomTemplate;<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboFooter>
<div class="combo__footer">
This is a custom footer
</div>
</ng-template>
</igx-combo> footerTemplate: TemplateRef<any> = null Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:643
headerItemTemplate
Section titled "headerItemTemplate"Inherited from: IgxComboBaseDirective
The custom template, if any, that should be used when rendering HEADER ITEMS for groups in the combo list
// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.headerItemTemplate = myCustomTemplate;<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboHeaderItem let-item let-key="groupKey">
<div class="custom-item--group">Group header for {{ item[key] }}</div>
</ng-template>
</igx-combo> headerItemTemplate: TemplateRef<any> = null Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:664
headerTemplate
Section titled "headerTemplate"Inherited from: IgxComboBaseDirective
The custom template, if any, that should be used when rendering the HEADER for the combo items list
// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.headerTemplate = myCustomTemplate;<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboHeader>
<div class="combo__header">
This is a custom header
</div>
</ng-template>
</igx-combo> headerTemplate: TemplateRef<any> = null Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:620
itemsWidth
Section titled "itemsWidth"Inherited from: IgxComboBaseDirective
Configures the drop down list width
// get
let myComboItemsWidth = this.combo.itemsWidth;<!--set-->
<igx-combo [itemsWidth] = '"180px"'></igx-combo> itemsWidth: string Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:300
itemTemplate
Section titled "itemTemplate"Inherited from: IgxComboBaseDirective
The custom template, if any, that should be used when rendering ITEMS in the combo list
// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.itemTemplate = myCustomTemplate;<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboItem let-item let-key="valueKey">
<div class="custom-item">
<div class="custom-item__name">{{ item[key] }}</div>
<div class="custom-item__cost">{{ item.cost }}</div>
</div>
</ng-template>
</igx-combo> itemTemplate: TemplateRef<any> = null Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:597
opened
Section titled "opened"Inherited from: IgxComboBaseDirective
Emitted after the dropdown is opened
<igx-combo (opened)='handleOpened($event)'></igx-combo> opened: EventEmitter<IBaseEventArgs> Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:523
opening
Section titled "opening"Inherited from: IgxComboBaseDirective
Emitted before the dropdown is opened
<igx-combo opening='handleOpening($event)'></igx-combo> opening: EventEmitter<IBaseCancelableBrowserEventArgs> Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:513
overlaySettings
Section titled "overlaySettings"Inherited from: IgxComboBaseDirective
Set custom overlay settings that control how the combo's list of items is displayed. Set:
<igx-combo [overlaySettings]="customOverlaySettings"></igx-combo>const customSettings = { positionStrategy: { settings: { target: myTarget } } };
combo.overlaySettings = customSettings;Get any custom overlay settings used by the combo:
const comboOverlaySettings: OverlaySettings = myCombo.overlaySettings; overlaySettings: OverlaySettings = null Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:166
placeholder
Section titled "placeholder"Inherited from: IgxComboBaseDirective
Defines the placeholder value for the combo value field
// get
let myComboPlaceholder = this.combo.placeholder;<!--set-->
<igx-combo [placeholder]='newPlaceHolder'></igx-combo> placeholder: string Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:316
searchInputUpdate
Section titled "searchInputUpdate"Inherited from: IgxComboBaseDirective
Emitted when the value of the search input changes (e.g. typing, pasting, clear, etc.)
<igx-combo (searchInputUpdate)='handleSearchInputEvent($event)'></igx-combo> searchInputUpdate: EventEmitter<IComboSearchInputEventArgs> Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:563
searchPlaceholder
Section titled "searchPlaceholder"Defines the placeholder value for the combo dropdown search field
searchPlaceholder: string Defined in projects/igniteui-angular/combo/src/combo/combo.component.ts:147
selectionChanged
Section titled "selectionChanged"Emitted when item selection is changed, after the selection completes
<igx-combo (selectionChanged)='handleSelection()'></igx-combo> selectionChanged: EventEmitter<IComboSelectionChangedEventArgs> Defined in projects/igniteui-angular/combo/src/combo/combo.component.ts:167
selectionChanging
Section titled "selectionChanging"Emitted when item selection is changing, before the selection completes
<igx-combo (selectionChanging)='handleSelection()'></igx-combo> selectionChanging: EventEmitter<IComboSelectionChangingEventArgs> Defined in projects/igniteui-angular/combo/src/combo/combo.component.ts:157
showSearchCaseIcon
Section titled "showSearchCaseIcon"Inherited from: IgxComboBaseDirective
Defines whether the caseSensitive icon should be shown in the search input
// get
let myComboShowSearchCaseIcon = this.combo.showSearchCaseIcon;<!--set-->
<igx-combo [showSearchCaseIcon]='true'></igx-combo> showSearchCaseIcon: boolean = false Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:136
toggleIconTemplate
Section titled "toggleIconTemplate"Inherited from: IgxComboBaseDirective
The custom template, if any, that should be used when rendering the combo TOGGLE(open/close) button
// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.toggleIconTemplate = myCustomTemplate;<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboToggleIcon let-collapsed>
<igx-icon>{{ collapsed ? 'remove_circle' : 'remove_circle_outline'}}</igx-icon>
</ng-template>
</igx-combo> toggleIconTemplate: TemplateRef<any> = null Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:731
valueKey
Section titled "valueKey"Inherited from: IgxComboBaseDirective
Determines which column in the data source is used to determine the value.
// get
let myComboValueKey = this.combo.valueKey;<!--set-->
<igx-combo [valueKey]='myKey'></igx-combo> valueKey: string = null Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:354
width
Section titled "width"Inherited from: IgxComboBaseDirective
Sets the style width of the element
// get
let myComboWidth = this.combo.width;<!--set-->
<igx-combo [width]='250px'></igx-combo> width: string Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:214
Inherited from: IgxComboBaseDirective
data: any[] Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:327, projects/igniteui-angular/combo/src/combo/combo.common.ts:330
disableFiltering
Section titled "disableFiltering"Inherited from: IgxComboBaseDirective
disableFiltering: boolean Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:142, projects/igniteui-angular/combo/src/combo/combo.common.ts:145
displayKey
Section titled "displayKey"Inherited from: IgxComboBaseDirective
displayKey: string Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:357, projects/igniteui-angular/combo/src/combo/combo.common.ts:378
filteringOptions
Section titled "filteringOptions"Inherited from: IgxComboBaseDirective
filteringOptions: IComboFilteringOptions Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:960, projects/igniteui-angular/combo/src/combo/combo.common.ts:963
groupKey
Section titled "groupKey"Inherited from: IgxComboBaseDirective
groupKey: string Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:391, projects/igniteui-angular/combo/src/combo/combo.common.ts:403
groupSortingDirection
Section titled "groupSortingDirection"Inherited from: IgxComboBaseDirective
groupSortingDirection: SortingDirection Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:419, projects/igniteui-angular/combo/src/combo/combo.common.ts:422
Inherited from: IgxComboBaseDirective
id: string Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:183, projects/igniteui-angular/combo/src/combo/combo.common.ts:187
itemHeight
Section titled "itemHeight"Inherited from: IgxComboBaseDirective
itemHeight: number Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:278, projects/igniteui-angular/combo/src/combo/combo.common.ts:282
itemsMaxHeight
Section titled "itemsMaxHeight"Inherited from: IgxComboBaseDirective
itemsMaxHeight: number Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:246, projects/igniteui-angular/combo/src/combo/combo.common.ts:253
resourceStrings
Section titled "resourceStrings"Inherited from: IgxComboBaseDirective
resourceStrings: IComboResourceStrings Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:498, projects/igniteui-angular/combo/src/combo/combo.common.ts:501
totalItemCount
Section titled "totalItemCount"Inherited from: IgxComboBaseDirective
totalItemCount: number Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:909, projects/igniteui-angular/combo/src/combo/combo.common.ts:920
Inherited from: IgxComboBaseDirective
type: IgxInputGroupType Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:483, projects/igniteui-angular/combo/src/combo/combo.common.ts:487
valid
Section titled "valid"Inherited from: IgxComboBaseDirective
valid: IgxInputState Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:826, projects/igniteui-angular/combo/src/combo/combo.common.ts:838
virtualizationState
Section titled "virtualizationState"Inherited from: IgxComboBaseDirective
virtualizationState: IForOfState Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:875, projects/igniteui-angular/combo/src/combo/combo.common.ts:886
Accessors
Section titled "Accessors"collapsed
Section titled "collapsed"Inherited from: IgxComboBaseDirective
Gets drop down state.
let state = this.combo.collapsed;get collapsed(): boolean Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:897
Returns boolean
displayValue
Section titled "displayValue"Inherited from: IgxComboBaseDirective
The text displayed in the combo input
// get
let comboDisplayValue = this.combo.displayValue;get displayValue(): string Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:863
Returns string
selection
Section titled "selection"Inherited from: IgxComboBaseDirective
Get current selection state
get selection(): any[] Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:1145
Returns any[]
value
Section titled "value"Inherited from: IgxComboBaseDirective
The value of the combo
// get
let comboValue = this.combo.value;get value(): any[] Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:851
Returns any[]
Methods
Section titled "Methods"close
Section titled "close"Inherited from: IgxComboBaseDirective
A method that closes the combo.
<button type="button" (click)="combo.close()">Close Combo</button>
<igx-combo #combo></igx-combo>close(): void Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:1126
Returns void
deselect
Section titled "deselect"Deselect defined items
deselect(items: any[], event: Event): void Defined in projects/igniteui-angular/combo/src/combo/combo.component.ts:313
Parameters
- items:
any[]items to deselected
this.combo.deselect(["New York", "New Jersey"]); - event:
Event
Returns void
deselectAllItems
Section titled "deselectAllItems"Deselect all (filtered) items
deselectAllItems(ignoreFilter: boolean, event: Event): void Defined in projects/igniteui-angular/combo/src/combo/combo.component.ts:342
Parameters
- ignoreFilter:
booleanif set to true, deselects all items, otherwise deselects only the filtered ones.
this.combo.deselectAllItems(); - event:
Event
Returns void
ngAfterViewChecked
Section titled "ngAfterViewChecked"Inherited from: IgxComboBaseDirective
A callback method that is invoked immediately after the default change detector has completed one change-check cycle for a component's view.
ngAfterViewChecked(): void Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:1009
Returns void
onArrowDown
Section titled "onArrowDown"onArrowDown(event: Event): void Defined in projects/igniteui-angular/combo/src/combo/combo.component.ts:194
Parameters
- event:
Event
Returns void
onEscape
Section titled "onEscape"onEscape(event: Event): void Defined in projects/igniteui-angular/combo/src/combo/combo.component.ts:201
Parameters
- event:
Event
Returns void
Inherited from: IgxComboBaseDirective
A method that opens the combo.
<button type="button" (click)="combo.open()">Open Combo</button>
<igx-combo #combo></igx-combo>open(): void Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:1108
Returns void
select
Section titled "select"Select defined items
select(newItems: any[], clearCurrentSelection: boolean, event: Event): void Defined in projects/igniteui-angular/combo/src/combo/combo.component.ts:298
Parameters
- newItems:
any[]new items to be selected
- clearCurrentSelection:
booleanif true clear previous selected items
this.combo.select(["New York", "New Jersey"]); - event:
Event
Returns void
selectAllItems
Section titled "selectAllItems"Select all (filtered) items
selectAllItems(ignoreFilter: boolean, event: Event): void Defined in projects/igniteui-angular/combo/src/combo/combo.component.ts:328
Parameters
- ignoreFilter:
booleanif set to true, selects all items, otherwise selects only the filtered ones.
this.combo.selectAllItems(); - event:
Event
Returns void
setSelectedItem
Section titled "setSelectedItem"Selects/Deselects a single item
setSelectedItem(itemID: any, select: boolean, event: Event): void Defined in projects/igniteui-angular/combo/src/combo/combo.component.ts:369
Parameters
- itemID:
anythe itemID of the specific item
- select:
booleanIf the item should be selected (true) or deselected (false)
Without specified valueKey;
this.combo.valueKey = null; const items: { field: string, region: string}[] = data; this.combo.setSelectedItem(items[0], true);With specified valueKey;
this.combo.valueKey = 'field'; const items: { field: string, region: string}[] = data; this.combo.setSelectedItem('Connecticut', true); - event:
Event
Returns void
toggle
Section titled "toggle"Inherited from: IgxComboBaseDirective
A method that opens/closes the combo.
<button type="button" (click)="combo.toggle()">Toggle Combo</button>
<igx-combo #combo></igx-combo>toggle(): void Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:1088
Returns void
triggerCheck
Section titled "triggerCheck"Inherited from: IgxComboBaseDirective
Triggers change detection on the combo view
triggerCheck(): void Defined in projects/igniteui-angular/combo/src/combo/combo.common.ts:1133