title: Exporting Filtered Data from Kendo Grid with Save Window
body: <p>I have a kendo grid and I had to accomplish the exporting of it's data into Excel format that I acheived through below function.</p>
  
  <pre><code>function ExportData() {
      var targetGrid = $('#divSearchGrid').data("kendoGrid");
      var dataSource = targetGrid.dataSource;
  
      var dataView = dataSource .view();
      var result = '';
  
      result = "data:application/vnd.ms-excel,";
  
  
          //Defining the headers
          result += "&lt;table&gt;&lt;tr&gt;&lt;th&gt;Task ID&lt;/th&gt;&lt;th&gt;Task Description&lt;/th&gt;&lt;th&gt;Assigned To Name&lt;/th&gt;&lt;/tr&gt;";
  
          //Filling in the data
          for (var i = 0; i &lt; dataView.length; i++) {
              result += "&lt;tr&gt;";
  
              result += "&lt;td&gt;";
              result += dataView[i].TaskID;
              result += "&lt;/td&gt;";
  
              result += "&lt;td&gt;";
              result += dataView[i].TaskDescription;
              result += "&lt;/td&gt;";
  
              result += "&lt;td&gt;";
              result += dataView[i].AssignedToName;
              result += "&lt;/td&gt;";
  
              result += "&lt;/tr&gt;";
          }
          result += "&lt;/table&gt;";
      aLink.href = result;
      aLink.download = 'exporteddata@.xls';
      aLink.click();
  }
  </code></pre>
  
  <p>Problem 1:
  If filtering is applied it doesn't take that into account and show all the results . I want only the filtered data to be shown in the grid.</p>
  
  <p>Problem 2:
  Right now the download is beginning as and when a user clicks on the Export button which in turn calls this function. I want that it should ask for a saving location before starting downloading the created excel.</p>