我正在尝试将以前保存的条目更新为Kendo Grid,但每当取消编辑弹出窗口时,该行都会被删除。
这是我的剑道网格代码:
@(Html.Kendo().Grid<Rezcue.Models.PassengerGrid>()
.Name("Passenger")
.Columns(columns =>
{
columns.Bound(p => p.PassengerID).Width(50);
columns.Bound(p => p.Name).Width(100);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160);
})
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.Pageable()
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:430px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Events(x=>x.Change("Test"))
.Model(model => { model.Id(p => p.PassengerID); model.Field(x => x.PassengerID); model.Field(x => x.Name); })
.Read(read => read.Action("PassengerDetailTemplate", "GetData"))
.Create(update => update.Action("EditingPopup_Update", "GetData"))
.Update(update => update.Action("EditingPopup_Update", "GetData"))
.Destroy(update => update.Action("EditingPopup_Destroy", "GetData"))
)
)