hii !!! i using jqgrid  (jqsuitePHP 4.6 ) but nothing appears  what’s the problem !! pleaaase helpÂ
grid.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
$dns = ‘mysql:host=localhost;dbname=gestion_conges’;
$utilisateur = ‘root’;
$motDePasse = ”;
$conn= new PDO( $dns, $utilisateur, $motDePasse );
// MySQL specific command for the charset
// Tell the db that we use utf-8
$conn->query(“SET NAMES utf8”);
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Data from this SQL is 1252 encoded, so we need to tell the grid
// Set the SQL Data source
$table = ‘personnel’;
$grid->SelectCommand =’SELECT * FROM ‘.$table;
// set the ouput format to XML
$grid->dataType = ‘json’;
// Let the grid create the model
$grid->setColModel();
// set labels in the header
$grid->setColProperty(“nom”, array(“label”=>”Nom”));
$grid->setColProperty(“prenom”, array(“label”=>”Prenom”));
$grid->setColProperty(“date”, array(“label”=>”Date de naissance”));
$grid->setColProperty(“cin”, array(“label”=>”CIN”));
$grid->setColProperty(“type”, array(“label”=>”Type”));
$grid->setColProperty(“num1”, array(“label”=>”Téléphone(1)”));
$grid->setColProperty(“num2”, array(“label”=>”Téléphone(2)”));
$grid->setColProperty(“adresse”, array(“label”=>”Adresse”));
$grid->setColProperty(“matricule”, array(“label”=>”Matricule”));
$grid->setUrl(‘grid.php’);
// Set some grid options
//$grid->setGridOptions(array(“rowNum”=>10,”rowList”=>array(10,20,30),”sortname”=>”CategoryID”));
// Enable toolbar searching
/*$sql = ‘SELECT * FROM personnel’;
$req = $conn->query($sql);
while($row = $req->fetch()) {
echo $row.”
“;
}
$req->closeCursor(); */
$grid->toolbarfilter = true;
$grid->setFilterOptions(array(“stringResult”=>true));
// Enjoy
$grid->renderGrid(‘#grid’,’#pager’,true, null, null, true,true);
$conn = null;
?>
Â
grid.html
require_once ‘tabs.php’;
?>
Â
jqGrid PHP Demo
//
?>
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top