We have a problem in our Kendo Grid Pop up Update modal, when a user idles for some time (approx 20 min to 1 hr), and after they tried saving a data in the form, we get an error about our tokens expiring, is there any way to generate one and apply it, or solutions that we can add in the kendo grid actions to avoid them losing data when saving after an idle time.
Below is the PopUp script. Will you be able to show how from here?
<div class="col-xs-18 col-md-12">
@(Html.Kendo().Grid<MyGrid.MVC.Models.Project>
()
.Name("projectGrid")
.Columns(columns =>
{
columns.Bound(p => p.STName).Filterable(filterable => filterable.UI("PSTFilter")).Title("PS Team");
columns.Bound(p => p.ASTeam);
columns.ForeignKey(p => p.ITId, (System.Collections.IEnumerable)ViewData["ITId"], "Id", "Name");
columns.Command(command => { command.Edit(); command.Destroy(); }).Width("13%");
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("ProjectForm"))
.Events(events => events.Edit("insertPopupCaption"))
.Pageable()
.Sortable()
.Resizable(resize => resize.Columns(true))
.Scrollable()
.Filterable(filterable => filterable.Extra(false))
.HtmlAttributes(new { style = "height:750px;width:95%;" })
.DataSource(dataSource => dataSource
.Ajax()
.Filter(p => p.Add(prj => prj.DevStatusId).IsEqualTo(1010))//1010 is On going status
.PageSize(20)
.Model(model =>
{
model.Id(p => p.Id);
})
.Read(read => read.Action("GetData", "Project"))
.Create(create => create.Action("UpsertData", "Project"))
.Update(update => update.Action("UpsertData", "Project"))
.Destroy(update => update.Action("DeleteData", "Project"))
)
)
</div>¬¬
Below is the PopUp script. Will you be able to show how from here?
<div class="col-xs-18 col-md-12">
@(Html.Kendo().Grid<MyGrid.MVC.Models.Project>
()
.Name("projectGrid")
.Columns(columns =>
{
columns.Bound(p => p.STName).Filterable(filterable => filterable.UI("PSTFilter")).Title("PS Team");
columns.Bound(p => p.ASTeam);
columns.ForeignKey(p => p.ITId, (System.Collections.IEnumerable)ViewData["ITId"], "Id", "Name");
columns.Command(command => { command.Edit(); command.Destroy(); }).Width("13%");
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("ProjectForm"))
.Events(events => events.Edit("insertPopupCaption"))
.Pageable()
.Sortable()
.Resizable(resize => resize.Columns(true))
.Scrollable()
.Filterable(filterable => filterable.Extra(false))
.HtmlAttributes(new { style = "height:750px;width:95%;" })
.DataSource(dataSource => dataSource
.Ajax()
.Filter(p => p.Add(prj => prj.DevStatusId).IsEqualTo(1010))//1010 is On going status
.PageSize(20)
.Model(model =>
{
model.Id(p => p.Id);
})
.Read(read => read.Action("GetData", "Project"))
.Create(create => create.Action("UpsertData", "Project"))
.Update(update => update.Action("UpsertData", "Project"))
.Destroy(update => update.Action("DeleteData", "Project"))
)
)
</div>¬¬