Have run into a problem wiht jqGrid when I try to export a table to PDF, Excel or CSV.
Every time I run the code I get "Call to Undefined Method::jqGrid::exportToPdf" (or Excel or CSV, depending on which method I am using.
Here is a snip of the client side:
.jqGrid('navButtonAdd', '#ors_registrant_pager', {
id: 'exportToPdf',
caption: '',
title: 'Download PDF',
onClickButton: function(){
grid.jqGrid('excelExport',{tag:"pdf","url":"info.php"});
}
Here is the server side php script in info.php:
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
$conn->query("SET NAMES utf8");
$grid = new jqGrid($conn);
$grid->SelectCommand = "SELECT lastName, firstName FROM user_table";
$grid->ExportCommand = "SELECT lastName FROM user_table";
$grid->dataType = "json";
$export = $_POST["oper"];
if($export == "pdf") {
$grid->exportToPdf();
} else {
$grid->queryGrid();
}
The grid loads correctly on the pageload, but as stated, when you click the PDF button on the bar I get that error. I've tried using all the parameters for the method to what is above with the same result. I've traced and the exportToPdf method does indeed exist in the jqGrid class.
I've searched and can't find any references to the problem. Any help would be much appreciated.
UPDATE
moved to Answer