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

Persisting Grid options (page, filter, ...) in URL

1 Answer 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mauricio
Top achievements
Rank 1
Mauricio asked on 04 May 2017, 02:39 PM

Hi,

I've been looking for a way to persist a grid's options, specifically page, page size, sort, filter, and group options, to the URL, in order to make shareable URLs that will set the grid data automatically.

I found this post and the referenced example, which I also found on Github, but unless I'm missing something big, this example simple serializes the options to the URL, but it never configures the grid with the options passed in the URL.

Still, inspired by this example, I experimented by manually parsing the URL. It took me a while to figure out that I have to allow a first binding before I can change settings such as page or page size, but I got that working. My problem now is the filter. A filter object is serialized into something like 'category~eq~somecat' and I can't figure out how to convert it back into an object that I can pass back to the query method. I guess I'll have similar problems with sorting and grouping.

Is there a built-in method to convert back the values serialized in the samples I mentioned? Or a sample that shows how to do this?

Thanks in advance,

Mauricio

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 08 May 2017, 11:54 AM
Hello Mauricio, 

In this scenario, I can suggest the following article demonstrating how to store the parameters and then apply them again:

https://vikutech.blogspot.bg/2014/07/storing-and-restoring-kendo-grid-state.html

I hope this will help to achieve the desired result.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 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
Mauricio
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or