Skip to content

Setup

Setup

Requirements

On server side, we need:

1) A Webserver running PHP v5.4+ (v5.4 and onwards)

2) Database server (Mysql, Sql-Server, Oracle, SQLite or any other you use)

On client side, we have tested it on famous browsers of Windows, MacOS and Linux.

Installing Demos using Web Installer

1) Extract the downloaded product archive in web root. e.g. www/phpgrid

2) Open it in browser to run installer. e.g. http://localhost/phpgrid and following the intallation steps.

Installing Demos Manually

1) Execute "database.sql" on a Mysql Database. It will create 'griddemo' database.

2) Place all files in a directory on the web server. e.g. ".../www/phpgrid/"

3) Rename config.sample.php to config.php, and update database config. e.g.

define("PHPGRID_DBTYPE","mysqli");
define("PHPGRID_DBHOST","localhost");
define("PHPGRID_DBUSER","root");
define("PHPGRID_DBPASS","");
define("PHPGRID_DBNAME","griddemo");

// It will work in normal cases, unless you change lib folder location
define("PHPGRID_LIBPATH",dirname(__FILE__).DIRECTORY_SEPARATOR."lib".DIRECTORY_SEPARATOR);

4) Run the product demos in browser. e.g. http://localhost/phpgrid/index.php

Integration in your Project

To integration in your app, copy 'lib' folder to your project. You need to consider 3 things.

1) Set DB config

$db_conf = array();
$db_conf["type"] = "mysqli";
$db_conf["server"] = PHPGRID_DBHOST; // or you mysql ip
$db_conf["user"] = PHPGRID_DBUSER; // username
$db_conf["password"] = PHPGRID_DBPASS; // password
$db_conf["database"] = PHPGRID_DBNAME; // database

// pass connection array to jqgrid()
$g = new jqgrid($db_conf);

2) The folder ../../lib will be replaced by path where you place lib folder (if changed)

<link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/themes/start/jquery-ui.custom.css"></link> 
<link rel="stylesheet" type="text/css" media="screen" href="../../lib/js/jqgrid/css/ui.jqgrid.css"></link>  
<script src="../../lib/js/jquery.min.js" type="text/javascript"></script>
<script src="../../lib/js/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="../../lib/js/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>  
<script src="../../lib/js/themes/jquery-ui.custom.min.js" type="text/javascript"></script>

3) Update include path where you place lib/inc/ folder (if changed)

include("../../lib/inc/jqgrid_dist.php");
$g = new jqgrid($db_conf);

Upgrading from older version

Simply override lib/inc & lib/js from latest build to the phpgrid folder in previous implementations. You may need to clear browser cache as well to remove the effect of old JS and CSS files. Same applies to upgrade from free to full version.

^ Top