Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your code is exporting the <code>outerHTML</code> of the grid. This of course includes all HTML (header, footer, data etc.). Since you have paging enabled the grid HTML will include only the current page of data. </p> <p>Also after checking your fiddle it seems that you are using serverPaging which means you don't have all the data to begin with. You need to disable serverPaging if you want to have all data. Then create the HTML of the grid by traversing the result of the <a href="http://docs.kendoui.com/api/framework/datasource#data" rel="nofollow">data</a>() method of the data source.</p> <pre><code>$("#btnExport").click(function(e) { var data = $("#grid").data("kendoGrid").dataSource.data(); var result = "data:application/vnd.ms-excel,"; result += "&lt;table&gt;&lt;tr&gt;&lt;th&gt;OrderID&lt;/th&gt;&lt;th&gt;Freight&lt;/th&gt;&lt;th&gt;Order Date&lt;/th&gt;&lt;th&gt;Ship Name&lt;/th&gt;&lt;th&gt;Ship City&lt;/th&gt;&lt;/tr&gt;"; for (var i = 0; i &lt; data.length; i++) { result += "&lt;tr&gt;"; result += "&lt;td&gt;"; result += data[i].OrderID; result += "&lt;/td&gt;"; result += "&lt;td&gt;"; result += data[i].Freight; result += "&lt;/td&gt;"; result += "&lt;td&gt;"; result += kendo.format("{0:MM/dd/yyyy}", data[i].OrderDate); result += "&lt;/td&gt;"; result += "&lt;td&gt;"; result += data[i].ShipName; result += "&lt;/td&gt;"; result += "&lt;td&gt;"; result += data[i].ShipCity; result += "&lt;/td&gt;"; result += "&lt;/tr&gt;"; } result += "&lt;/table&gt;"; window.open(result); e.preventDefault(); }); </code></pre> <p>Here is the updated jsfiddle: <a href="http://jsfiddle.net/SZBrt/4/" rel="nofollow">http://jsfiddle.net/SZBrt/4/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload