我是 jQuery/jQgrid 编码的新手。我使用的 jQgrid 版本是 4.4.4 & jQuery 1.8.3。我想在我的 jQgrid 中启用导出到 PDF/EXCEL 功能。为此,我参考了以下链接 -单击此处并单击此处。在此链接的基础上,我在 jquery 中开发了几行代码,如下所示:
.jqGrid('navGrid', topPagerSelector, { edit: false, add: false, del: false, search: false, pdf: true}, {}, {}, {}, {}
}).jqGrid('navButtonAdd',topPagerSelector,{
id:'ExportToPDF',
caption:'',
title:'Export To Pdf',
onClickButton : function(e)
{
try {
$("#tbPOIL").jqGrid('excelExport', { tag: 'pdf', url: sRelativePath + '/rpt/poil.aspx' });
} catch (e) {
window.location = sRelativePath + '/rpt/poil.aspx&oper=pdf';
}
},
buttonicon: 'ui-icon-print'
});
但是这段代码不能正常工作。我在互联网谷歌上搜索了很多,但我没有得到有用和相关的信息来完成我的任务。有人知道怎么做吗???
更新:我没有使用付费版本的 jqgrid。