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;
Gets/sets the role
attribute of the item. Default is 'option'.
<igx-drop-down-item [role]="customRole"></igx-drop-down-item>
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;
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 IgxDropDownGroup
will always count as disabled
Sets/gets if the given item is focused
let mySelectedItem = this.dropdown.selectedItem;
let isMyItemFocused = mySelectedItem.focused;
Sets/gets if the given item is focused
let mySelectedItem = this.dropdown.selectedItem;
let isMyItemFocused = mySelectedItem.focused;
The data index of the dropdown item.
// get the data index of the selected dropdown item
let selectedItemIndex = this.dropdown.selectedItem.index
Sets/Gets if the item is the currently selected one in the select
let mySelectedItem = this.select.selectedItem;
let isMyItemSelected = mySelectedItem.selected; // true
Sets/Gets if the item is the currently selected one in the dropdown
let mySelectedItem = this.dropdown.selectedItem;
let isMyItemSelected = mySelectedItem.selected; // true
Two-way data binding
<igx-drop-down-item [(selected)]='model.isSelected'></igx-drop-down-item>
Gets/Sets the item's text to be displayed in the select component's input when the item is selected.
//get
let mySelectedItem = this.dropDown.selectedItem;
let selectedItemText = mySelectedItem.text;
// set
<igx-select-item [text]="'London'"></igx-select-item>
The
<igx-drop-down-item>
is a container intended for row items in a<igx-drop-down>
container.