Kendo ui 滚动时缺少剑道网格错误
我有简单的剑道滚动网格。它在开始时显示20个项目,滚动时会动态获取更多数据并添加到网格中 通常在网格加载时获取第一页数据时,当dataService抛出如下异常时:Kendo ui 滚动时缺少剑道网格错误,kendo-ui,telerik,kendo-grid,kendo-asp.net-mvc,Kendo Ui,Telerik,Kendo Grid,Kendo Asp.net Mvc,我有简单的剑道滚动网格。它在开始时显示20个项目,滚动时会动态获取更多数据并添加到网格中 通常在网格加载时获取第一页数据时,当dataService抛出如下异常时: return new HttpStatusCodeResult((int)HttpStatusCode.ServiceUnavailable, this.T("System Error - retrying.").Text); 我的js方法绑定在配置中 Events(events => events.Error("acc.m
return new HttpStatusCodeResult((int)HttpStatusCode.ServiceUnavailable, this.T("System Error - retrying.").Text);
我的js方法绑定在配置中
Events(events => events.Error("acc.mp.gridErrorDialog"))
捕捉它并显示正确的消息
问题在于下一页,当网格获得更多数据时。
我已经看到,当我触摸滚动并滚动3行时会发生这种情况,即使页面大小为20,grid也会尝试将数据输入缓冲区,以便在我滚动20个项目时显示它们
但当这个操作中发生错误时,就像第一次查询一样,剑道网格不会立即显示它,因为我还没有搜索到20行,只是它将其保存在他的缓冲区中,什么也没有发生,当我滚动到20行时,spinner会显示所有的frezes。未激发方法acc.mp.gridErrorDialog
网格初始化:
public static GridBuilder<T> InitializeGrid<T>(this GridBuilder<T> gridBuilder, string gridName, string dataBindAction, string controllerName, object routeValues) where T : class
{
if (gridBuilder == null)
{
throw new ArgumentNullException("gridBuilder");
}
return
gridBuilder
.Name(gridName)
.TableHtmlAttributes(new { Class = "styled", cellpadding = "0", border = "0", margin = "0" })
.HtmlAttributes(new { Class = "dynamicGridHeight" })
.AutoBind(false)
.DataSource(
dataSource =>
dataSource.Ajax()
.PageSize(ModelPortfolioConfigurationManager.GridPageSize)
.ServerOperation(true)
.Events(events => events.Error("acc.mp.gridErrorDialog"))
.Read(read => read.Action(dataBindAction, controllerName, AddAntispinnerParameter(routeValues))));
}
和网格:
@(Html.Kendo()
.Grid<ValidatedClientAccountViewModel>()
.InitializeGrid(Naming.GridId(GridType.Upper), "GetClients, "ModelClients", new { modelTemplateId = Model.ModelId })
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(o => o.AccountId)))
.ToolBar(toolBar => toolBar.Template(
@<text>
<script type="text/javascript">
acc.mp.utils.bindLiveSearch($("#@Naming.GridId(GridType.Upper) input[name='txtSearch']"), function () { $("#@Naming.GridId(GridType.Upper) button[name='btnSearch']").click(); });
acc.mp.utils.searchGridFocus($("#@Naming.GridId(GridType.Upper) input[name='txtSearch']"));
</script>
</text>))
.Columns(columns =>
{
columns.Bound(o => o.AccountId)
.ClientTemplate(ClientTemplates.UpperGridRowSelection)
.HtmlAttributes(new { style = "text-align: center" })
.HeaderTemplate(ClientTemplates.SelectAllCheckBox("cbLinkAll"))
.HeaderHtmlAttributes(new { style = "text-align: center" })
.Filterable(true)
.Sortable(false)
.Width(35);
columns.Bound(o => o.ClientReferenceNumber).Title(accountReference).HeaderHtmlAttributes(new { title = accountReference });
})
.EnableScrollingAndPaging(ModelPortfolioConfigurationManager.GridPageSize)
.Sortable()
.Events(events =>
{
events.DataBinding("acc.mp.clientAccounts.upperGrid.dataBinding");
events.DataBound("acc.mp.clientAccounts.upperGrid.dataBound");
events.Change("acc.mp.clientAccounts.upperGrid.rowSelect");
})
)
这是剑道中的一个bug,你可以在这里跟踪问题的状态