这是我使用 aspl.net mvc 包装器的剑道网格。问题是当您进行批量内联编辑时。然后点击保存。
.Create(create => create.Action("UpdateLiabilities", "Liability", parameters))
将被触发并将所有更改保存到数据库中。现在我需要添加一个回调函数来显示一个帐户成功添加的消息。我不确定如何添加此回调函数。
@(Html.Kendo().Grid<LiabilityVM>()
.Name("QualifiedNonrecourseDebtGrid")
.HtmlAttributes(new { style = "height: 300px;" })
.Columns(columns =>
{
columns.Bound(i => i.Id).Visible(false);
columns.Bound(i => i.AccountId).Visible(false);
columns.Bound(i => i.AccountNumber)
.Title("Account #")
.ClientTemplate("<span style='white-space:nowrap'><a href='\\#' onclick=\"showAccountInfo('acctInfoPopupContainer', " + parameters.clientId + ", " + parameters.projectId + ",#=WorkpaperId#, #=AccountId#, '#=AccountNumber#', '#=AccountNumberAndDescAndLabel#')\"> #= AccountNumber # </a></span>")
.HtmlAttributes(new { nowrap = "nowrap" })
.Width(70);
columns.Bound(i => i.Description)
.Title("Description")
.ClientTemplate("<span href='\\#' title='#= getEncodedValueOrDefault(Description, '')#' style='white-space:nowrap'>#= getHtmlEncode(Description, '') #</span>")
.HtmlAttributes(new { nowrap = "nowrap" })
.Width(120);
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.DataSource(grid => grid.Ajax()
.Batch(true)
.Model(model => {
model.Id(i => i.Id);
model.Field(p => p.AccountNumber).Editable(false);
})
.ServerOperation(true).Group(groups => groups.Add(p => p.Source))
.Create(create => create.Action("UpdateLiabilities", "Liability", parameters))
.Read(read => read.Action("GetLiabilities", "Liability", parameters))
.Update(update => update.Action("UpdateLiabilities", "Liability", parameters))
.Aggregates(aggregates =>
{
aggregates.Add(p => p.TaxAdjustmentBalance).Sum();
})
)
.Sortable()
.Filterable()
.Selectable(s => s.Mode(GridSelectionMode.Single))
.Resizable(resize => resize.Columns(true))
.Reorderable(reorder => reorder.Columns(true))
.ColumnMenu()
.Scrollable()
)