MVC Kendo Grid export to excel by clicking extenrally placed button -
i have special scenario excel export functionality on kendo-ui mvc grid.
scenario: export kendo mvc grid excel sheet , when clicking button placed outside of grid, don't want show or use default export excel button provided kendo, instead want use html input button. please me on this? appreciated.
please try below code snippet.
<div id="grid"></div> <input type="button" onclick="downlaodexcel()" value="export excel" /> <script> $("#grid").kendogrid({ datasource: { type: "odata", transport: { read: "http://demos.telerik.com/kendo-ui/service/northwind.svc/products" }, pagesize: 10 }, sortable: true, pageable: true, columns: [ { width: 300, field: "productname", title: "product name" }, { field: "unitsonorder", title: "units on order" }, { field: "unitsinstock", title: "units in stock" } ] }); function downlaodexcel() { $("#grid").getkendogrid().saveasexcel(); } </script>
let me know if concern.
Comments
Post a Comment