Class IgxDropDownItemBaseDirective

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()

Hierarchy

Hierarchy

Implements

  • DoCheck

Constructors

Properties

Accessors

Methods

Constructors

Properties

id: string = ...

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;

Memberof

IgxSelectItemComponent

isHeader: boolean

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>
role: string = 'option'

Gets/sets the role attribute of the item. Default is 'option'.

 <igx-drop-down-item [role]="customRole"></igx-drop-down-item>
value: any

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;

Accessors

Methods