title: send kendoGrid parameters(filters, sort) for file download
body: <p>I am trying to send my filters from a grid in order to export an excel file with the filters applied. I am new to kendo, and I am having difficulties sending the filters,page,sorting to the controller. Here is what i have so far :</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public JsonResult List([DataSourceRequest] DataSourceRequest request)
      {
          //generating list to send to the grid
  
          return Json(list.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
      }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>Html.Kendo().Grid(Model)
      .Name("tokenList")
      .Columns(columns =&gt;
      {
       // columns for the model   
      })
      .DataSource(d =&gt; d.Ajax()
          .ServerOperation(true)
          .Read(read =&gt; { read.Action("List", "Settings", null); })
      )
      .ToolBar(toolbar =&gt;
      {
          toolbar.Template(
              @&lt;text&gt;
  
                           &lt;a href="@Url.Action("ExportToExcel", "Settings", new { page = 1, pageSize = "~", filter = "~", sort = "~" })" class="export" onclick="onDataBound()"&gt;EXPORT&lt;/a&gt;
  
  
               &lt;/text&gt;
              );
      })
      .DefaultSetupForApp(&lt;-this adds filtering, sortable, pageable).
  Render(); 
  }
  </code></pre>
  
  <p>And this is my JS function for getting parameters(I saw this piece of code somewhere else, and I am trying to adapt it, here is where i think i need help)</p>
  
  <pre><code>function onDataBound(e) {
      var grid = this;
  
      // ask the parameterMap to create the request object for you
  
      **I need some info on this part, nothing i found was very helpful**
  
      var requestObject = (new kendo.data.transports["aspnetmvc-server"]({ prefix: "" }))
      .options.parameterMap({
          page: grid.dataSource.page(),
          sort: grid.dataSource.sort(),
          filter: grid.dataSource.filter()
      });
  
  
      // Get the export link as jQuery object
      var $exportLink = grid.element.find('.export');
  
      // Get its 'href' attribute - the URL where it would navigate to
      var href = $exportLink.attr('href');
  
      // Update the 'page' parameter with the grid's current page
      href = href.replace(/page=([^&amp;]*)/, 'page=' + requestObject.page || '~');
  
      // Update the 'sort' parameter with the grid's current sort descriptor
      href = href.replace(/sort=([^&amp;]*)/, 'sort=' + requestObject.sort || '~');
  
      // Update the 'pageSize' parameter with the grid's current pageSize
      href = href.replace(/pageSize=([^&amp;]*)/, 'pageSize=' + grid.dataSource.total());
  
      //update filter descriptor with the filters applied
  
      href = href.replace(/filter=([^&amp;]*)/, 'filter=' + (requestObject.filter || '~'));
  
      // Update the 'href' attribute
      $exportLink.attr('href', href);
  }
  </code></pre>
  
  <p>I just want to send the filters to the controller. Can you help me ?</p>