Class IgxSelectItemComponent

The <igx-drop-down-item> is a container intended for row items in a <igx-drop-down> container.

Hierarchy

Hierarchy (view full)

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;

IgxSelectItemComponent

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

  • get disabled(): boolean
  • 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

    Returns boolean

  • set disabled(value): void
  • Parameters

    • value: boolean

    Returns void

  • get selected(): any
  • Sets/Gets if the item is the currently selected one in the select

     let mySelectedItem = this.select.selectedItem;
    let isMyItemSelected = mySelectedItem.selected; // true

    Returns any

  • set selected(value): void
  • 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>
    

    Parameters

    • value: any

    Returns void

Methods