3

当我在 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"            
    });
4

1 回答 1

1

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

于 2015-03-03T19:43:55.470 回答