剑道网格:性能问题缓慢

use*_*358 9 jquery asp.net-mvc-4 kendo-ui kendo-grid

问题在于Kendo网格的性能缓慢,当尝试加载1000多条记录时,网格需要大约8秒才能加载.我可以看到控制器在3秒内返回json数据,然后kendo网格需要时间来填充.

我有一个500个记录的PageSize并使用了DataSourceRequest,因此每个页面的数据只会从控制器返回.但仍然没有快乐.

任何人都可以建议我如何提高电网性能.

请在下面找到我的代码

 @(Html.Kendo().Grid<Model>()
.Name("KendoTestGrid")     
.Columns(columns =>
{

    columns.Bound(p => p.Column5)
          .Width("18%")             
          .ClientTemplate("#= formatResult(format(column5, '')) #")
          .EditorTemplateName("Column5")
          .ClientFooterTemplate("<span href='\\#'  id='total'>Total : </span>");             
    columns.Bound(p => p.Column6)
         .EditorTemplateName("Column6")
         .ClientTemplate("#= format(column6, '') #")                       
         .ClientFooterTemplate("<span href='\\#' id='spanfooter'></span>")             
         .Width("23%");
    columns.Bound(p => p.column7)             
         .ClientTemplate("<span href='\\#'  id='#=Id #'>#= format(Column7,'')#</span>")
         .ClientFooterTemplate("<span href='\\#'  id='spansum'></span>")
         .HtmlAttributes(new { Class = "number" })
         .Width("18%");
    columns.Bound(p => p.column8)
         .EditorTemplateName("column8")            
         .ClientFooterTemplate("Total:")
         .ClientFooterTemplate("<span href='\\#'  id='TotalSum1'></span>")           
         .Width("23%");      
})

.DataSource(dataSource => dataSource
    .Ajax()      
    .Batch(true)
    .ServerOperation(true)      
    .Read(read => read.Action("Action", "Controller").Data("getData"))
    .Create(c => c.Action("Action", "Controller").Data("getData2"))
    .Update(update => update.Action("Action", "Controller").Data("getData3"))
    .PageSize(500) .Events(x => x.DataBound("ongriddatabound")
    .Edit("ongridedit")
    .Change("ongridchange"))   
    .Editable(editing => editing.Mode(Kendo.Mvc.UI.GridEditMode.InCell))

    .Filterable()
    .Groupable()       
    .Sortable()
    .Scrollable()
    .Pageable()
    .Selectable(s => s.Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
    .Resizable(resize => resize.Columns(true))
    .AutoBind(false)
)
Run Code Online (Sandbox Code Playgroud)

dca*_*son 1

在网格上启用 UI 虚拟化。

$(document).ready(function(){
      $("#grid").kendoGrid({
         scrollable: {
             virtual: true // <--- This
         }
      });
  });
Run Code Online (Sandbox Code Playgroud)

如果这没有帮助,我建议实施服务器端分页。