KendoUI Autocomplete 不允许我连续两次选择同一个项目。如果我选择一个项目,然后选择另一个项目,它当然会起作用,但不是背靠背。
通过放置select方法this.trigger('change')
,如果您单击列表本身中的项目,它将起作用,但是如果您输入相同的内容并按Enter,则不会触发更改事件。kendoAutoComplete({})
- 键入 Anne,单击它(注意它会将其添加到正文中(更改事件已触发))
- 再试一次(没有任何反应)
只是一些示例代码:jsFiddle 示例
var autoComplete = $("#input").kendoAutoComplete({
// other methods...
select: function (e) {
console.log('---SELECT---');
// this will work if we select the same thing and SELECT the item
// from the the dropdown list,
// ** but if we push ENTER, it won't trigger this
//this.trigger('change'); // <--
},
change : function (e) {
console.log(' >> CHANGE');
$('body').append('<br>' + this.value());
}
});