Asp.net mvc mvc剑道组合框加载速度非常慢
我已经实现了一个kendo combox控件,它填充了10000条记录。在表单加载过程中以及选择comboxbox查看列表时都存在延迟。解决此性能问题的最佳方法是什么。如果您注意到,这个组合将实现级联功能。它根据另一个组合的countrycode值进行过滤 剑道组合Asp.net mvc mvc剑道组合框加载速度非常慢,asp.net-mvc,kendo-ui,kendo-combobox,Asp.net Mvc,Kendo Ui,Kendo Combobox,我已经实现了一个kendo combox控件,它填充了10000条记录。在表单加载过程中以及选择comboxbox查看列表时都存在延迟。解决此性能问题的最佳方法是什么。如果您注意到,这个组合将实现级联功能。它根据另一个组合的countrycode值进行过滤 剑道组合 <div class="form-group"> @Html.LabelFor(model => model.Name1, htmlAttributes: new { @cla
<div class="form-group">
@Html.LabelFor(model => model.Name1, htmlAttributes: new { @class = "control-label col-md-4" })
<div class="col-md-8">
<div class="editor-field">
@(Html.Kendo().ComboBoxFor(model => model.CustomerMasterDataId)
.HtmlAttributes(new { style = "width:100%" })
.DataTextField("CustomerNumberName")
.Placeholder("Select...")
.DataValueField("CustomerMasterDataId")
.Filter("contains")
.MinLength(3)
.DataSource(dataSource => dataSource
.Read(read =>
{
read.Action("RequestHeader_CustomerData", "Request")
.Type(HttpVerbs.Post)
.Data("GetSalesOfficeFilter");
}).ServerFiltering(true)
).CascadeFrom("CountryCode").Filter("contains")
.Events(e =>
{
e.Change("onCustomerComboChange");
})
)
</div>
@Html.ValidationMessageFor(model => model.Name1, "", new { @class = "text-danger" })
</div>
Conroller代码
public ActionResult RequestHeader_CustomerData(string id)
{
var response = requestRepository.GetCustomerData(id).AsQueryable().ProjectTo<CustomerViewModel>();
var jsonResult = Json(response, JsonRequestBehavior.AllowGet);
jsonResult.MaxJsonLength = int.MaxValue;
return jsonResult;
}
您可能会将所有记录发送给客户端—使用开发人员工具查看json负载。我看不到任何标准被传递给您的操作,因此,如果有任何筛选正在进行,它将在客户端进行,但我不太熟悉剑道服务器筛选。服务器筛选将是限制从服务器返回的项目数目的一个很好的方法。是指向组合框服务器端筛选功能演示的链接。