jqGrid 导出excel表格代码(php+jqgrid实例)
Jun 13, 2016 am 11:24 AM
jqgrid 导出excel表格代码(php教程+jqgrid实例)
require_once '../../../tabs.php';
?>
jqgrid php demo
php代码
require_once '../../../jq-config.php';
// include the jqgrid class
require_once abspath."php/jqgrid.php";
// include the driver class
require_once abspath."php/jqgridpdo.php";
// connection to the server
$conn = new pdo(db_dsn,db_user,db_password);
// tell the db that we use utf-8
$conn->query("set names utf8");// create the jqgrid instance
$grid = new jqgridrender($conn);
// write the sql query
$grid->selectcommand = 'select orderid, orderdate, customerid, freight, shipname from longorders';
// set the ouput format to json
$grid->datatype = 'json';
// let the grid create the model
$grid->setcolmodel();
// set the url from where we obtain the data
$grid->seturl('grid.php');
$grid->optimizesearch = true;
// set some grid options
$grid->setgridoptions(array("rownum"=>100,"sortname"=>"orderid","height"=>150));
// change some property of the field(s)
$grid->setcolproperty("orderdate", array(
"formatter"=>"date",
"formatoptions"=>array("srcformat"=>"y-m-d h:i:s","newformat"=>"m/d/y"),
"search"=>false
)
);
// enable toolbar searching
$grid->toolbarfilter = true;
$grid->setfilteroptions(array("stringresult"=>true));
// enjoy
$grid->rendergrid('#grid','#pager',true, null, null, true,true);
$conn = null;
?>

Artikel Panas

Alat panas Tag

Artikel Panas

Tag artikel panas

Notepad++7.3.1
Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Cina
Versi Cina, sangat mudah digunakan

Hantar Studio 13.0.1
Persekitaran pembangunan bersepadu PHP yang berkuasa

Dreamweaver CS6
Alat pembangunan web visual

SublimeText3 versi Mac
Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

Topik panas

Langkah-langkah melaraskan format gambar yang disisipkan dalam jadual PPT

Cara menapis lebih daripada 3 kata kunci pada masa yang sama dalam excel

Apakah yang perlu saya lakukan jika garis bingkai hilang semasa mencetak dalam Excel?

Bagaimana untuk menukar mod keserasian jadual excel kepada mod biasa

Di mana untuk menetapkan mod bacaan excel

Bagaimana untuk menetapkan superskrip dalam excel

Cara menggunakan fungsi iif dalam excel
