This is a migrated thread and some comments may be shown as answers.

Timeout/Token Expiring on PopUp Editor

1 Answer 82 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
John Louie
Top achievements
Rank 1
John Louie asked on 11 Jul 2019, 12:46 PM
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>¬¬
 

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 15 Jul 2019, 10:40 AM
Hi John,

The behavior you describe can be caused when the Session times out. In order to avoid such errors I recommend prompting the user before the actual timeout occurs so they can prevent it. The stackoverflow thread below describes how to show an alert when the Session is about to expire. 


You can use similar approach and show a Kendo confirmation popup that enables the user to reset the timeout counter. That way the users will be able to continue the Session and editing in the Grid would work as expected after that.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Data Source
Asked by
John Louie
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or