Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

igCombo template doesn`t effect selected item

When I set index in selectedItems properety in order to display preset value in igCombo, provided itemTemplate is not used for generating the text value.

$(selector).igCombo({
        dataSource: this.userComboDs,
        width: '300px',
        textKey: 'line1',
        valueKey: 'id',
        mode: 'dropdown',
        enableClearButton: false,
        closeDropDownOnSelect: true,
        itemTemplate: "<span>${city}, ${line1}</span>",
        selectedItems: [
          {
              index: 1 // random index value
          }],
        selectionChanged: function (evt, ui){
        },
        filteringType: "local",
        filterCondition: "contains",
        renderMatchItems: "contains"            
    });
like image 592
user3793702 Avatar asked Nov 29 '25 13:11

user3793702


1 Answers

The itemTemplate is only applicable to the items in the igCombo list. The input field of the igCombo is populated with the text key data property of the selected item.

like image 74
Konstantin Dinev Avatar answered Dec 01 '25 03:12

Konstantin Dinev