An abstract class defining a drop-down item:
With properties / styles for selection, highlight, height
Bindable property for passing data (value: any)
Parent component (has to be used under a parent with type IDropDownBase)
Method for handling click on Host()
Constructors
Section titled "Constructors"IgxDropDownItemBaseDirective
new IgxDropDownItemBaseDirective(): IgxDropDownItemBaseDirective Returns IgxDropDownItemBaseDirective
Properties
Section titled "Properties"Sets/gets the id of the item.
<igx-drop-down-item [id] = 'igx-drop-down-item-0'></igx-drop-down-item>let itemId = this.item.id; id: string Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:38
isHeader
Section titled "isHeader"Sets/gets if the given item is header
// get
let mySelectedItem = this.dropdown.selectedItem;
let isMyItemHeader = mySelectedItem.isHeader;<!--set-->
<igx-drop-down-item *ngFor="let item of items">
<div *ngIf="items.indexOf(item) === 5; then item.isHeader = true">
{{item.field}}
</div>
</igx-drop-down-item> isHeader: boolean Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:183
Gets/sets the role attribute of the item. Default is 'option'.
<igx-drop-down-item [role]="customRole"></igx-drop-down-item> role: string = 'option' Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:223
value
Section titled "value"Gets/sets the value of the item if the item is databound
// usage in IgxDropDownItemComponent
// get
let mySelectedItemValue = this.dropdown.selectedItem.value;
// set
let mySelectedItem = this.dropdown.selectedItem;
mySelectedItem.value = { id: 123, name: 'Example Name' }
// usage in IgxComboItemComponent
// get
let myComboItemValue = this.combo.items[0].value; value: any Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:95
ariaLabel
Section titled "ariaLabel"ariaLabel: string Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:42, projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:46
disabled
Section titled "disabled"disabled: boolean Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:206, projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:210
focused
Section titled "focused"focused: boolean Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:147, projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:160
index
Section titled "index"index: number Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:66, projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:73
selected
Section titled "selected"selected: boolean Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:121, projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:125
Methods
Section titled "Methods"ngDoCheck
Section titled "ngDoCheck"A callback method that performs change-detection, invoked
after the default change-detector runs.
See KeyValueDiffers and IterableDiffers for implementing
custom change checking for collections.
ngDoCheck(): void Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:284