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

Retain grid state on page load

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Logan
Top achievements
Rank 1
Veteran
Logan asked on 06 Nov 2017, 06:59 PM

Here is what I am trying to achieve in a nutshell:

 

User filters/sorts grid in whatever way they desire. User leaves page and comes back to said grid in the same state that it was left in. Is there any way to do this through event handlers/without using buttons?

 

Thanks!

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 07 Nov 2017, 03:04 PM
Hello Logan,

I assembled a small sample that illustrates how you can implement the functionality. The state for the Grid is persisted in the beforeunload event handler. This way any operations performed by the users before leaving the page will be persisted. 

In order to restore the state you can use the document.ready event. Make sure that you check if there is anything persisted beforehand to avoid script errors.  

The sample below illustrates the approach. It is using the Kendo UI jQuery Grid, however, the relevant code for persisting the state will be the same when using the MVC wrapper.



Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Logan
Top achievements
Rank 1
Veteran
Answers by
Viktor Tachev
Telerik team
Share this question
or