Kendo ui 在剑道UI组合框中未找到任何内容
有没有办法通知用户,他的搜索查询没有找到任何内容?类似于JIRA组合框中的内容。>Kendo ui 在剑道UI组合框中未找到任何内容,kendo-ui,kendo-combobox,Kendo Ui,Kendo Combobox,有没有办法通知用户,他的搜索查询没有找到任何内容?类似于JIRA组合框中的内容。> 没有集成,但您可以自己轻松构建 看这个 基本上,正在发生的是: 从服务器返回。如果找不到任何东西,则创建一个具有特殊id的虚拟条目 在组合框上注册Select事件 在事件中,检查所选项目是否具有您的特殊id,如果是,请使用e.preventDefault()取消事件 代码: $('input').kendoComboBox({ dataTextField: 'text', dataValueFie
没有集成,但您可以自己轻松构建 看这个 基本上,正在发生的是:
$('input').kendoComboBox({
dataTextField: 'text',
dataValueField: 'id',
dataSource: {
transport: {
read: function(options) {
//instead, specify ajax call!
options.success([{ id: -1, text: 'No Matches...' }]);
}
}
},
placeholder: "Select...",
select: function(e) {
var dataItem = this.dataItem(e.item.index());
if(dataItem.id === -1) {
e.preventDefault();
}
}
});