I have developed an ASP.NET MVC 4 web application which uses JQgrid to generate tables.
I also need to Export my Grid data to an Excel File.Is it possible in Jqgrid. I searched in 'trirand'
and i cant see any jQgrid demo to export grid data.
Should i use any library to Export data to Excel or is there any feature available in Jqgrid to Export data.
Any help is appreciated.
Script
$("#Grid").jqGrid('navButtonAdd', '#Pager', {
caption: "Export to Excel",
buttonicon:"ui-icon-save",
onClickButton: function () {
var gridData = $("#Grid").jqGrid('getRowData');
var dataToSend = JSON.stringify(gridData);
jQuery("#Grid").jqGrid('excelExport', dataToSend);
}
});
Here i am trying to Export Json Data to Excel Format. But i am getting some error in grid.import.js file.
Uncaught TypeError: Cannot call method 'indexOf' of null --- grid.import.js:208