【问题标题】:Kendo UI AutoComplete (MVC) MinLength reloads all valuesKendo UI AutoComplete (MVC) MinLength 重新加载所有值
【发布时间】:2015-06-09 16:58:34
【问题描述】:

我有一个使用 MVC 助手的 Kendo UI 自动完成功能:

@(Html.Kendo().AutoCompleteFor(m => m)
     .DataSource(dataSource => dataSource.Read(read => read.Action("CustomerNames_Read", "Wells")))
     .DataTextField("Name")
     .MinLength(3))

MinLength 工作正常,仅在输入 3 个字母时检索值。

问题是,如果您清除该框,它将检索所有值(在本例中为 1000+)。我怎样才能阻止这种情况?

在演示中可以看到相同的行为:

http://demos.telerik.com/kendo-ui/autocomplete/index

输入一个字母,例如“b”,然后将其删除 - 将检索所有值。

【问题讨论】:

  • 遇到同样的问题!
  • 我从来没有找到这个@gsharp 的解决方案!我会看看能不能从 Telerik 那里得到帮助 - 我需要修复它!
  • 好的。如果他们给你一个好的答案,请告诉我。谢谢:)

标签: kendo-ui kendo-asp.net-mvc kendo-autocomplete


【解决方案1】:

我在 Telerik 提出了支持请求。答案是这显然是设计使然,因为customers wanted it that way

这可以通过实现一些 JavaScript 客户端来防止(参见demo

由于我对 JavaScript 方法不太满意,所以我提出了一个功能请求,它像这样扩展了 MinLenght

.MinLength(int length, bool triggerOnEmptyText = true)

不确定是否会实施,我会在得到答案后立即更新。

更新:

从 Telerik 获得反馈。除非它在用户语音中获得高票,否则他们不会实施它。 所以如果你喜欢这个功能请投票here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-19
    • 1970-01-01
    • 1970-01-01
    • 2012-12-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多