The <igx-drop-down-item> is a container intended for row items in
a <igx-drop-down> container.
Constructors
Section titled "Constructors"IgxDropDownItemComponent
new IgxDropDownItemComponent(): IgxDropDownItemComponent Returns IgxDropDownItemComponent
Properties
Section titled "Properties"Inherited from: IgxDropDownItemBaseDirective
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"Inherited from: IgxDropDownItemBaseDirective
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
Inherited from: IgxDropDownItemBaseDirective
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"Inherited from: IgxDropDownItemBaseDirective
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
Accessors
Section titled "Accessors"ariaLabel
Section titled "ariaLabel"Inherited from: IgxDropDownItemBaseDirective
get ariaLabel(): string Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:42
Returns string
set ariaLabel(value: string): void Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:46
Parameters
- value:
string
Returns void
disabled
Section titled "disabled"Inherited from: IgxDropDownItemBaseDirective
Sets/gets if the given item is disabled
// get
let mySelectedItem = this.dropdown.selectedItem;
let myItemIsDisabled = mySelectedItem.disabled;<igx-drop-down-item *ngFor="let item of items" disabled={{!item.disabled}}>
<div>
{{item.field}}
</div>
</igx-drop-down-item>NOTE: Drop-down items inside of a disabled drop down group will always count as disabled
get disabled(): boolean Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:206
Returns boolean
set disabled(value: boolean): void Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:210
Parameters
- value:
boolean
Returns void
focused
Section titled "focused"Sets/gets if the given item is focused
let mySelectedItem = this.dropdown.selectedItem;
let isMyItemFocused = mySelectedItem.focused; get focused(): boolean Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.component.ts:26
Returns boolean
Sets/gets if the given item is focused
let mySelectedItem = this.dropdown.selectedItem;
let isMyItemFocused = mySelectedItem.focused; set focused(value: boolean): void Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.component.ts:43
Parameters
- value:
boolean
Returns void
index
Section titled "index"Inherited from: IgxDropDownItemBaseDirective
The data index of the dropdown item.
// get the data index of the selected dropdown item
let selectedItemIndex = this.dropdown.selectedItem.index get index(): number Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:66
Returns number
set index(value: number): void Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.base.ts:73
Parameters
- value:
number
Returns void
selected
Section titled "selected"Sets/Gets if the item is the currently selected one in the dropdown
let mySelectedItem = this.dropdown.selectedItem;
let isMyItemSelected = mySelectedItem.selected; // trueTwo-way data binding
<igx-drop-down-item [(selected)]='model.isSelected'></igx-drop-down-item> get selected(): boolean Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.component.ts:59
Returns boolean
Sets/Gets if the item is the currently selected one in the dropdown
set selected(value: boolean): void Defined in projects/igniteui-angular/drop-down/src/drop-down/drop-down-item.component.ts:71
Parameters
- value:
boolean
Returns void
Methods
Section titled "Methods"ngDoCheck
Section titled "ngDoCheck"Inherited from: IgxDropDownItemBaseDirective
A callback method that performs change-detection, invoked
after the default change-detector has checked the directive's input
bindings in the parent template.
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