[英]Filtering with the Kendo UI ComboBox in the ASP.NET MVC on array of numbers
我在Kendo UI ComboBox中使用帶有整數列表的過濾時遇到問題。 我將整數列表用作數據源 , StartsWith和ServerFiltering(false)類型的Filter。
@(Html.Kendo().ComboBox().Placeholder("Jahr")
.IgnoreCase(true)
.Name("planungsZeiten")
.Filter(FilterType.StartsWith)
.DataSource(source => source.Read(read => read.Action("GetPlanungsZeiten", "Reweco"))
.ServerFiltering(false)))
public JsonResult GetPlanungsZeiten()
{
using (var repo = new ANECON_PDATAEntities())
{
return Json(repo.PlanungsZeiten.Select(j => j.Jahr).OrderByDescending(j => j).ToList(), JsonRequestBehavior.AllowGet);
}
}
當我在ComboBox中鍵入內容時,會引發JavaScript異常:
對象不支持屬性或方法“ toLowerCase”
發生這種情況是因為類型編號不支持toLower方法。
我使用的版本是2013.1.514,但最新版本2014 Q1 SP1(2014.1.416)的行為相同,如此處所示: http : //jsfiddle.net/akalcik/Fv8S5/1/
我已經嘗試設置.IgnoreCase(true),但沒有區別。 我有什么問題還是錯誤?
Startwith不是有效的整數類型過濾器。 您應該使用整數過濾器(等於,大於等),或者將基礎源整數字段的類型更改為string以應用字符串過濾器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.