tonytomov / jqGrid

jQuery grid plugin
www.trirand.com
2.84k stars 1.2k forks source link

exportToHtml,but there is no data #936

Closed XShandow closed 5 years ago

XShandow commented 5 years ago

Thanks for jqgrid. When I use exportToHtml to print ,there is only header without no data.

JS jQuery(#grid-table).jqGrid('navButtonAdd', pager_selector, { caption: "Print", buttonicon: 'ace-icon fa fa-search-plus grey', title: 'Print', id: 'Print', position: "first", onClickButton: function () { $("#grid-table").jqGrid("exportToHtml",{ includeLabels : true, includeGroupHeader : true, includeFooter: true, autoPrint : true }); } });

JSP:

<link rel="stylesheet" href="<%=basePath%>assets/css/bootstrapValidator.min.css"/> <script type="text/javascript" src="<%=basePath%>assets/js/bootstrapValidator.min.js">

XShandow commented 5 years ago

jqGrid JS - v5.3.2 jQuery v2.1.1

tonytomov commented 5 years ago

Can you please post the jqGrid setup. The export work only on local data and if there is a datatype:"json" it will not export. I highly recommend you to look at the docs: http://www.guriddo.net/documentation/guriddo/javascript/user-guide/exporting/

XShandow commented 5 years ago

Thanks,I use loadonce: true,now it is ok