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

2 posts, 0 answers
  1. Mauricio
    Mauricio avatar
    1 posts
    Member since:
    Sep 2016

    Posted 04 May 2017 Link to this post

    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

  2. Stefan
    Admin
    Stefan avatar
    3039 posts

    Posted 08 May 2017 Link to this post

    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.
Back to Top