Hi,
I am trying to retain the edit mode of the cell in the Gantt Chart when the modelState has errors.
<script>
function error(e) {
var grid = $("#gantt").data("kendoGantt");
grid.one("dataBinding", function(args) {
e.preventDefault();
});
if (e.errors) {
var msg = "";
$.each(e.errors, function(key, value) {
if (value.hasOwnProperty("errors")) {
$.each(value.errors, function() {
msg += this + "<br />";
});
}
});
alert(msg);
}
}
</script>
@(Html.Kendo().Gantt<TaskGantt, TaskGanttDependency>()
.Name("gantt")
.DataSource(ds => ds
.Read(read => read
.Action("Tasks", "Home")
)
.Update(update => update
.Action("Update", "Home")
)
.Events(events => events
.Error("error")
)
.Model(m =>
{
m.Id(f => f.Id);
m.ParentId(f => f.ParentId);
m.OrderId(f => f.OrderId);
m.Field(f => f.Expanded).DefaultValue(true);
})
)
.DependenciesDataSource(ds => ds
.Read(read => read
.Action("Dependencies", "Home")
)
.Model(m =>
{
m.Id(f => f.DependencyId);
m.PredecessorId(f => f.PredecessorId);
m.SuccessorId(f => f.SuccessorId);
m.Type(f => f.Type);
})
)
.Columns(columns =>
{
columns.Bound("title").Editable(true).Sortable(true);
columns.Bound("end").Title("End Time").Format("{0:MM/dd/yyyy}").Width(100).Editable(true).Sortable(true);
})
.Views(views =>
{
views.WeekView(weekView => weekView.Selected(true));
views.MonthView();
})
.Events(events=> events
.DataBound("onDataBound")
)
.Height(500)
.ShowWorkHours(false)
.ShowWorkDays(false)
.Snap(false)
.Resizable(true)
)
I have used the above code, but i am not able to retain the edit mode for a single cell when the ModelState has errors.I have attached the image of how the gantt chart should look after update is called and ModelState returns error.
Can i get to know if I have missed any thing or any other approach is there to carry on with the requirement.
Thanks