igCombo模板不影响所选项目

igCombo template doesn`t effect selected item

本文关键字:选项 项目 影响 igCombo      更新时间:2023-11-18

当我在selectedItems属性中设置索引以在igCombo中显示预设值时,假设itemTemplate不用于生成文本值。

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

itemTemplate仅适用于igCombo列表中的项目。igCombo的输入字段填充有所选项目的文本键数据属性。