Running PHP Grid in Debug Mode

Due to any configuration issue if your server is generating errors, you can view the exact technical issue behind it by using debug mode. Debug mode is enabled by default and it will show the server side failure reason. For e.g.

When going in production mode, you should disable the debug mode by following config.

$g = new jqgrid();
$g->debug = 0;

In non-debug mode if your grid generates errors for some unfortunate reason, it will be display non-technical message to contact support team.

Server-side Data Validation

To write your own insert/update/delete implementations, we use custom events that allows us to have our custom business case coding. We’ve added another helper function that will push your server side validation error to php grid, and display it as error dialog.

For example, if you have written your on_insert function, and want to validate that client does not already exist in database, you can write this code. It will prompt the ‘already exist’ message as data entry error.

The helper function name is ‘phpgrid_error’.

function add_client($data)
{
	$check_sql = "SELECT count(*) as c from clients where LOWER(`name`) = '".strtolower($data["params"]["name"])."'";
	
	$rs = mysql_fetch_assoc(mysql_query($check_sql));

	if ($rs["c"] > 0)
		phpgrid_error("Client already exist in database");

	mysql_query("INSERT INTO clients VALUES (null,'{$data["params"]["name"]}','{$data["params"]["gender"]}','{$data["params"]["company"]}')");
}

It is available in latest build, so eligible premium members can claim their copy.

Custom Validation Code on Client-side

Added another example of client side custom JS validation w.r.t. particular field. Now you can write your own validation implementation (be it ajax remote checking or complex regex) on each field while adding or editing information in php grid control. For example, certain value must be greater than 100.

	

If you wish to have back-end PHP level validation, it is also doable using custom on_insert and on_update events.

Currently, it is packaged in premium version. To request for premium package, click here

Conditional Row Formatting

Added new demo for css formatting of rows, based on certain conditional values. You need to define column,operator(cn/eq),value and css style for the row. It will highlight your grid rows as per your need.

This feature is currently available in paid package. Existing customers can request this demo when needed.

// conditional css formatting of rows

$f = array();
$f["column"] = "name"; // exact column name, as defined above in set_columns or sql field name
$f["op"] = "cn"; // cn - contains, eq - equals
$f["value"] = "Ana";
$f["css"] = "'background-color':'yellow'"; // must use (single quote ') with css attr and value
$f_conditions[] = $f;

$f = array();
$f["column"] = "invdate";
$f["op"] = "eq";
$f["value"] = "2007-10-31";
$f["css"] = "'background-color':'red', 'color':'white'";
$f_conditions[] = $f;

$f = array();
$f["column"] = "invdate";
$f["op"] = "cn";
$f["value"] = "2012";
$f["css"] = "'background-color':'lightgreen'";
$f_conditions[] = $f;

$g->set_conditional_css($f_conditions);

Above code result in following formatting …

Released PHP Grid Control v1.4.7 (for Premium Members)

We’ve released a new premium version covering several features and bug fixes as reported by our valuable community. Keep visiting website for future updates.

Have Fun!

Change Log:

– Integration with Oracle (db-layer-oracle.php)
– Frozen column example (frozen-column.php)
– Documentation (md) file added in package
– Master-detail example (master-detail.php)
– Multiple grids on same page (multiple-grid.php)
– PDF Export Current page (export-pdf.php)
– Bar Graph in Grid (bar-graph.php)
– Conditional Data display in Cell (custom-button.php)
– Postgres Integration and working example (db-layer-pgsql.php)
– Image display example added (images.php)

Several Fixes

– PHP 5.4 compatibility
– XLS export fix for non-english characters
– Autofilter fix for search in lookup
– SQL Server Sql Query optimization
– Export column ordering
– HTTPs fix for auto detection

Interested in Premium Package, Click here

PHP Grid & Oracle 11g

Recently added another working example to connect PHP Grid with Oracle 11g. It is completely transparent for developers,which database server is used at backend.

All you have to do is defining a valid db config. for e.g.

$db_conf = array();
$db_conf[“type”] = “oci8”; // mysql,oci8(for oracle),mssql,postgres,sybase
$db_conf[“server”] = “127.0.0.1:1521”;
$db_conf[“user”] = “user”;
$db_conf[“password”] = “password”;
$db_conf[“database”] = “xe”;

In case of help, create create you request at
http://www.phpgrid.org/support.

Have a super charged development speed !

PHP Grid WordPress Plugin (beta testers required)

UPDATE June 2019: New simplied tutorial is now published on website for wordpress integration.

We’ve developed a wordpress plugin that integrates phpgrid control in wordpress page or post using short code. Currently beta testers are required for validating the usage and needs. Interested participants can contact us back on this email: [email protected]

Update: To start, please follow the readme.md on github page:
http://github.com/gridphp/PHPGrid-Framework-Wordpress-Plugin

Thanks

Support Center Launched

We recently launched a new brand service center for community issues. All previous channels are closed now. We’ll try to migrate useful thread from our last discussion forum. Just in case some one need an urgent resolution, he can post thread from support center link

Also there is a FAQ article posted along articles section. More helping articles like tutorials, general integrations in frameworks are inshaAllah likely to be posted there in near future.

Just in case, you need premium support and more quick response, try connection with gtalk on [email protected] for live chat.