0
我已經實現了一個可以填充10,000條記錄的kendo combox控件。在表單加載期間以及在選擇comboxbox查看列表時存在延遲。解決這個性能問題的最佳方法是什麼?如果你注意到,級聯功能是爲這個組合實現的。它根據另一個組合的國家/地區代碼值進行過濾。mvc kendo組合框加載很慢
劍道組合
<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>
電腦板代碼
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;
}
服務器過濾將是限制從服務器返回的項目數的好方法。 [Here](http://demos.telerik.com/kendo-ui/combobox/serverfiltering)是組合框服務器端過濾功能演示的鏈接。 – Sandman