jquery grid
jquery grid
i m using jquery grid but nothing appears pleaasse help !!! thanks
grid .php
- <?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);
- try {
- $dns = 'mysql:host=localhost;dbname=gestion_conges';
- $utilisateur = 'root';
- $motDePasse = '';
- $conn= new PDO( $dns, $utilisateur, $motDePasse );
- } catch ( Exception $e ) {
- echo "Connection à MySQL impossible : ", $e->getMessage();
- die();
- }
- // 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
- $grid->toolbarfilter = true;
- $grid->setFilterOptions(array("stringResult"=>true));
- // Enjoy
- $grid->renderGrid('#grid','#pager',true, null, null, true,true);
- $conn = null;
- ?>