title: Parsing kendo grid filter strings into filter objects
body: <p>I've created a pseudo-grid widget of sorts (basically just a grid header) to allow the user to configure sorts and filters to their liking, and then save those configurations for future use. The issue is that they're returned from the database as strings. Unfortunately, I need a method of converting them back into javascript objects so I can apply them to the grid. </p>
  
  <p>I'm using the parameterMap function below to convert a DataSourceRequest object into something that can be posted to the controller action and saved in the database. The function just takes the objects returned from the <code>kendoGrid.dataSource</code> and turns them into a query string of sorts. So, this:</p>
  
  <pre><code>    // Get datasource of the filter grid, so we can save the search applied to it.
      var f = $("#filter-grid").data("kendoGrid").dataSource;
  
      // Set the filtering/sorting applied to the filter grid in the model being saved.
      e.model.Request = e.sender.dataSource.transport.parameterMap({
          filter: f.filter(),
          group: f.group(),
          page: f.page(),
          pageSize: f.pageSize(),
          sort: f.sort()
      });
  </code></pre>
  
  <p>returns this:</p>
  
  <pre><code>    Object {
          sort: "InvoiceNumber-asc", 
          page: 1, 
          pageSize: 100, 
          group: "", 
          filter: "Auditor~startswith~'Gabe'~and~Auditor~endswith~'Newell'"
      }
  </code></pre>
  
  <p>Is there any javascript function provided with the Kendo UI stuff that allows for parsing a query string into a javascript object? I basically want to reverse the results of the <code>parameterMap()</code> function. My ultimate goal is to avoid rolling my own method of parsing these strings back into objects, and it seems likely that something in the Kendo suite should take care of this for me.</p>
  
  <p>The Telerik documentation does provide a method to perform exactly what I'm looking for (<a href="http://www.telerik.com/help/aspnet-mvc/m_telerik_web_mvc_gridcommand_parse.html" rel="nofollow">GridCommand.Parse()</a>), but that's available in the controller and I need this to be done on the page. If I can find something akin to that MVC extension provided in their jQuery-based framework, then this just got considerably easier to implement.</p>
  
  <p>Thanks in advance.</p>