If a user adds a row but then wants to cancel it, I am trying to figure out how to add this functionality. The "cancel changes" button built into kendo is tied to toolbar.Save() which I am not using (we are saving changes in batch with a custom button).
@(Html.Kendo().Grid<x.Models.xModel>()
.Name("xGrid_#=PONum#_#=lineNum#")
.Columns(columns =>
{
columns.Bound(p => p.comment).Title("Comment").Width(50).HtmlAttributes(new { @maxlength = "1000"});
columns.Bound(p => p.updatedBy).Title("Updated By").Width(15).Editable("readOnlyCol");
columns.Bound(p => p.lastUpdated).Title("Last Updated").Width(15).Format("{0:MM/dd/yyyy}").Editable("readOnlyCol");
})
.ToolBar(toolbar => {
toolbar.Create();
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Selectable(selectable => selectable
.Mode(GridSelectionMode.Single))
.Events(ev => ev.Change("onChange"))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetX", "X", new { LineNbr = "#=lineNum#", purchaseOrderNbr = "#=PONum#" }).Data("GetFacilityCode"))
.Sort(sort => sort.Add("lastUpdated").Descending())
.PageSize(10)
)
.Sortable()
.Pageable()
.Width(500)
.ToClientTemplate())
If there is a way to add "cancel changes" and hide "save changes" when using toolbar.Save(), I would be OK with that too.