Kendo ui 剑道组合框过滤不起作用
我已经实现了剑道组合框控件并尝试了实现过滤器选项。我显示的文本字段是串联字段。我有 设置以下属性,但筛选似乎不起作用。当用户键入前几个字符时,它应该过滤记录Kendo ui 剑道组合框过滤不起作用,kendo-ui,asp.net-mvc-5,kendo-asp.net-mvc,Kendo Ui,Asp.net Mvc 5,Kendo Asp.net Mvc,我已经实现了剑道组合框控件并尝试了实现过滤器选项。我显示的文本字段是串联字段。我有 设置以下属性,但筛选似乎不起作用。当用户键入前几个字符时,它应该过滤记录 .Filter("contains") .ServerFiltering(true) 它不适用于我的其他组合框,这些组合框也不包含连接字段。我错过什么了吗 <div class="col-md-4"> <div class="form-group">
.Filter("contains")
.ServerFiltering(true)
它不适用于我的其他组合框,这些组合框也不包含连接字段。我错过什么了吗
<div class="col-md-4">
<div class="form-group">
@Html.LabelFor(model => model.Company, htmlAttributes: new { @class = "control-label col-md-4" })
<div class="col-md-8">
<div class="editor-field">
@(Html.Kendo().ComboBoxFor(model => model.CountryCode)
.HtmlAttributes(new { style = "width:100%" })
.DataTextField("CompanyCodeCompany")
.DataValueField("CountryCode")
.Filter("contains")
.MinLength(3)
.Events(e => e.DataBound("onCompanyComboChange"))
.Value(@user.DefaultCountryCode)
.DataSource(dataSource => dataSource
.Read(read => read.Action("RequestHeader_SalesOrganisation", "Request").Type(HttpVerbs.Post))
.ServerFiltering(true)
)
)
</div>
@Html.ValidationMessageFor(model => model.Company, "", new { @class = "text-danger" })
</div>
</div>
@LabelFor(model=>model.Company,htmlAttributes:new{@class=“controllabel col-md-4”})
@(Html.Kendo().ComboBoxFor(model=>model.CountryCode)
.HtmlAttributes(新的{style=“width:100%”)
.DataTextField(“公司代码公司”)
.DataValueField(“国家代码”)
.过滤器(“包含”)
.MinLength(3)
.Events(e=>e.DataBound(“onCompanyComboChange”))
.Value(@user.DefaultCountryCode)
.DataSource(DataSource=>DataSource
.Read(Read=>Read.Action(“RequestHeader\u SalesOrganization”,“Request”).Type(HttpVerbs.Post))
.ServerFiltering(true)
)
)
@Html.ValidationMessageFor(model=>model.Company,“,new{@class=“text danger”})
控制器
public ActionResult RequestHeader_SalesOrganisation()
{
var response = requestRepository.GetSalesOrganisation().AsQueryable().ProjectTo<SalesOrganisationViewModel>();
var jsonResult = Json(response, JsonRequestBehavior.AllowGet);
jsonResult.MaxJsonLength = int.MaxValue;
return jsonResult;
}
public ActionResult RequestHeader\u salesOrganization()
{
var response=requestRepository.GetSalesOrganization().AsQueryable().ProjectTo();
var jsonResult=Json(响应,JsonRequestBehavior.AllowGet);
jsonResult.MaxJsonLength=int.MaxValue;
返回jsonResult;
}
您必须手动在服务器端实现它,或者您可以设置.ServerFiltering(false)使其成为客户端。我设置了.ServerFiltering(false)。它不起作用。您有手动实现的示例吗查看本文,注意read方法上的filter参数。尝试使用.filter(FilterType.Contains)
而不是.filter>(“contains”)
尝试放置筛选器(FilterType.contains)。运气不佳