user3793702
user3793702

Reputation: 211

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"            
    });

Upvotes: 3

Views: 1402

Answers (1)

Konstantin Dinev
Konstantin Dinev

Reputation: 34905

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.

Upvotes: 1

Related Questions