我有一个Kendo Grid如下
<% Html.Kendo().Grid<MaintenanceAthletesAthleteGridViewModel>()
.Name("Athletes")
.HtmlAttributes(new { style = "height:435px" })
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(a => a.ResourceId))
.Events(e => e.RequestEnd("onRequestEnd"))
.Create(create => create.Action("InsertAthlete", "Maintenance"))
.Read(read => read.Action("AthletesMaintenanceAthleteGridAjax", "Maintenance"))
.Update(update => update.Action("UpdateAthlete", "Maintenance").Data("onAthleteGridUpdate"))
.Destroy(destroy => destroy.Action("DeleteAthlete", "Maintenance").Data("onAthleteGridUpdate"))
)
.Events(events => events
.Save("onAthleteGridSave")
.Edit("onAthleteGridEdit")
)
...
%>
function onRequestEnd(e)
{
if (e.type == "insert" || e.type == "update" || e.type == "destroy") {
$("#Athletes").data("kendoGrid").dataSource.read();
}
}
function onAthleteGridSave(e)
{
if (e.type == "insert")
{ ...}
}
function onAthleteGridEdit(e)
{
if (e.type == "insert")
{ ...}
}
但是onAthleteGridSave(e)和onAthleteGridEdit(e)中的e.type是未定义的,而onRequestEnd(e)中的e.type是可以的。我的问题是如何在onAthleteGridSave / onAthleteGridEdit中的e或其他任何地方找到诸如“插入”或“更新”的动作类型。谢谢。