I've got a grid with InCell editing and I have only the Add and Save buttons in the header. The grid is in an iframe. The trouble I am having is when I click the batch save button the controller action in the Datasource is not getting called.
<
div
>
@(Html.Kendo().Window()
.Name("timecard")
.Modal(true)
.Actions(actions => actions.Close())
.Draggable(false)
.LoadContentFrom("Timecard")
.Events(events => events
.Close("timecard_OnClose")
.Refresh("timecard_OnIframeLoaded")
)
.Iframe(true)
.Width(1700)
.Height(800)
.Visible(false)
.Deferred(true)
)
</
div
>
function timecard_OnIframeLoaded(e)
{
$.ajax({
url: '@Url.Action("Timecard_Load", "Timecard")',
type: "POST",
datatype: "json",
data: { id: employee_key, weekEnding: week_ending},
success: timecard_LoadTimecardSuccess
});
}
<
div
id
=
"employeeTimecard"
>
@(Html.Kendo().Grid<
Timecard.Models.TimecardViewModel
>()
.Name("timecard")
.ToolBar(toolbar =>
{
toolbar.Create().Text("ADD").HtmlAttributes(new { title = "Add employee" });
toolbar.Save().Text("SAVE");
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Columns(columns =>
{
columns.Bound(p => p.Job).Filterable(false).Sortable(false).Width(115).EditorTemplateName("_InCellAutoCompleteEditor").Title("Job");
columns.Bound(p => p.Task).Filterable(false).Sortable(false).Width(50);
columns.Bound(p => p.TaskName).Filterable(false).Sortable(false).Width(150);
columns.Bound(p => p.SubTask).Filterable(false).Sortable(false).Width(75);
columns.Bound(p => p.SubTaskCompDate).Filterable(false).Sortable(false).Width(75);
columns.Bound(p => p.TravelPay).Filterable(false).Sortable(false).Width(75).Title("Travel Pay (Total)");
columns.Bound(p => p.SpecialPayRate).Filterable(false).Sortable(false).Width(75);
columns.Bound(p => p.Comment).Filterable(false).Sortable(false).Width(150);
columns.Bound(p => p.MonST).Filterable(false).Sortable(false).Format("{0:n1}").Title("Mon ST").Width(40);
columns.Bound(p => p.MonOT).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.MonDT).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.TueST).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.TueOT).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.TueDT).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.WedST).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.WedOT).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.WedDT).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.ThuST).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.ThuOT).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.ThuDT).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.FriST).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.FriOT).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.FriDT).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.SatST).Filterable(false).Sortable(false).Hidden(true).Width(40);
columns.Bound(p => p.SatOT).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.SatDT).Filterable(false).Sortable(false).Width(40);
columns.Bound(p => p.SunST).Filterable(false).Sortable(false).Hidden(true).Width(40);
columns.Bound(p => p.SunOT).Filterable(false).Sortable(false).Hidden(true).Width(40);
columns.Bound(p => p.SunDT).Filterable(false).Sortable(false).Width(40);
columns.Command(command =>
{
command.Destroy().HtmlAttributes(new { title = "Delete highlighted employee"});
}).Title("Options").Width(100);
})
.Sortable()
.Scrollable()
.Filterable()
.HtmlAttributes(new { style = "height:650px;width:1615px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.PageSize(100)
.Model(model => model.Id(p => p.EmployeeCode))
.Update(update => update.Action("Timecard_Update", "Timecard"))
)
)
</
div
>