jqGrid PHP - exportToPdf/exportToExcel throws Call to Undefined Method -


have run problem wiht jqgrid when try export table pdf, excel or csv.

every time run code "call undefined method::jqgrid::exporttopdf" (or excel or csv, depending on method using.

here snip of client side:

.jqgrid('navbuttonadd', '#ors_registrant_pager', { id: 'exporttopdf', caption: '', title: 'download pdf', onclickbutton: function(){     grid.jqgrid('excelexport',{tag:"pdf","url":"info.php"}); } 

here 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 user_table"; $grid->exportcommand = "select lastname user_table"; $grid->datatype = "json";  $export = $_post["oper"];  if($export == "pdf") {     $grid->exporttopdf(); } else {     $grid->querygrid(); } 

the grid loads correctly on pageload, stated, when click pdf button on bar error. i've tried using parameters method above same result. i've traced , exporttopdf method indeed exist in jqgrid class.

i've searched , can't find references problem. appreciated.

update

moved answer

ok, happens many times, posted found answer. documentation not correct in trirand site php help. in states use jqgrid class pdf exports, apparently have use jqgridrender class instead.

to pdf export had change $grid declaration follows:

$grid = null;  $export = $_get["oper"];  if($export == "pdf"){     $grid = new jqgridrender($conn); } else {     $grid = new jqgrid($conn); } 

doing allows grid exported.

i going delete thread leaving in case others run same problem in hopes them out.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -