簡體   English   中英

在數字數組上使用ASP.NET MVC中的Kendo UI ComboBox進行過濾

[英]Filtering with the Kendo UI ComboBox in the ASP.NET MVC on array of numbers

我在Kendo UI ComboBox中使用帶有整數列表的過濾時遇到問題。 我將整數列表用作數據源StartsWithServerFiltering(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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM