如何刷新 Kendo UI 组合框? [英] How do I refresh a Kendo UI combo box?
本文介绍了如何刷新 Kendo UI 组合框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 ASP.Net MVC Kendo UI 组合框,它数据绑定到一个包含 1000 条记录的表.我已将 MinLength 属性设置为 5,因此我只返回相关结果.问题是,用户可能需要一起更改文本值.有没有办法告诉控件刷新?
I have an ASP.Net MVC Kendo UI combobox that is databound to a table with 1000's of records. I've set the MinLength property to 5 so I only return relevant results. The problem is, the user might need to change the text value all together. Is there a way to tell the control to refresh?
这是控件的代码...
@(Html.Kendo().ComboBoxFor(x => x.Product)
.Name("Product")
.DataTextField("Name") // Display value
.DataValueField("Id") //Return value
.MinLength(5)
.AutoBind(false)
.Suggest(true)
.Filter(FilterType.Contains)
.DataSource(source =>
{
source.Read(read =>
{
read.Action("Products", "Home").Data("onGetProducts");
});
})
)
推荐答案
如果我了解您正在努力解决的问题:只需从您需要的任何地方再次调用读取操作:
if I understand what you are struggling with: simply call read action again from where ever you need:
$("#Product").data("kendoComboBox").dataSource.read();
这篇关于如何刷新 Kendo UI 组合框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文