PHP code example of gridphp / gridphp-community
1. Go to this page and download the library: Download gridphp/gridphp-community library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gridphp / gridphp-community example snippets
define("PHPGRID_DBTYPE","mysqi");
define("PHPGRID_DBHOST","localhost");
define("PHPGRID_DBUSER","db_user");
define("PHPGRID_DBPASS","db_pass");
define("PHPGRID_DBNAME","your_db_name");
// Include the db config
ackage library code
$grid = new jqgrid();
// Define primary master table source target
$grid->table = "clients";
$grid->select_command = "SELECT id, name, company, reg_date, balance FROM clients";
// Set global operational parameters
$opt["rowNum"] = 20; // Initial row visibility counts
$grid->set_options($opt);
// Compile server configurations into HTML/JS wrappers
$output = $grid->render("my_first_grid");
// Intercept database writes with validation layer rules
$e["on_update"] = array("validate_and_update_client", null, true);
$grid->set_events($e);
function validate_and_update_client(&$data) {
// Inject automatic timestamp values securely on submission
$data["params"]["reg_date"] = date("Y-m-d H:i:s");
}
bash
cd gridphp-community
php -S localhost:8080