我正在使用此文档来使用自动完成搜索http://demos.kendoui.com/web/autocomplete/index.html
在这个自动完成中只有名称,而我想使用名称和 ID
$(document).ready(function () {
var data = [
{"value":"Albania","id":"1"},
{"value":"Andorra","id":"2"},
{"value":"Armenia","id":"3"},
{"value":"Austria","id":"4"},
{"value":"Azerbaijan","id":"5"},
{"value":"Belarus","id":"6"},
{"value":"Belgium","id":"7"},
{"value":"Bosnia & Herzegovina","id":"8"},
];
//create AutoComplete UI component
$("#countries").kendoAutoComplete({
dataSource: data,
filter: "startswith",
placeholder: "Select country...",
dataTextField: "value",
dataValueField: "value",
separator: ", "
});
});
此代码正在运行,但是当用户选择任何国家/地区名称时,我如何提醒 id