Version 6.0

phpgrid logo w slogan

This is a major release with many new features and enhancements.

New features:

  • composite primary key support,
  • autocomplete control,
  • sortable row,
  • nested/drill-down editable subgrid,
  • a column chooser,
  • Excel mode,
  • global theme and debug,
  • two new great looking premium themes,
  • a new row level permission function,
  • and many bugfixes.
  • The master detail feature has been massively enhanced.
  • In the back-end, this release adds an SQL Server Native driver and DB2 DSN-less connectivity support.

New Database Type

  • db2-dsnless
    • Now supports DB2 DSN-less as database type. Thanks, Jon Paris!
  • odbc_mssql_native
    • “odbc_mssql_native” DB_TYPE for SQL Server Native ODBC driver
    • “odbc_mssql” should be used for ***DSN-only connectivity *** on *nix, OS X using unixODBC through FreeTDS.
unixODBC requires environment variables in conf.php
putenv("ODBCINSTINI=/usr/local/Cellar/unixodbc/2.3.1/etc/odbcinst.ini");
putenv("ODBCINI=/usr/local/Cellar/unixodbc/2.3.1/etc/odbc.ini");
unixODBC is DSN connection only with the following .conf and .ini files. I used Amazon RDS MSSQL instance during testing.
/usr/local/Cellar/freetds/0.91/etc/freetds.conf
# server specific section
[global]
# TDS protocol version
; tds version = 4.2
# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug flags = 0xffff
# Command and connection timeouts
; timeout = 10
; connect timeout = 10
# If you get out-of-memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# Try setting 'text size' to a more reasonable limit
text size = 64512
[phpgridmssql]
host = phpgridmssql.cbdlprkhjrmd.us-west-1.rds.amazonaws.com
port = 1433
tds version = 7.0
/usr/local/Cellar/unixodbc/2.3.1/etc/odbc.ini
[phpgridmssql]
Description = MS SQL Server
Driver = FreeTDS
Server = phpgridmssql.cbdlprkhjrmd.us-west-1.rds.amazonaws.com
TraceFile = /tmp/sql.log
UID = mssqluser
PWD = PASSWORD
ReadOnly = No
Port = 1433
Database = sampledb
/usr/local/Cellar/unixodbc/2.3.1/etc/odbcinst.ini
[FreeTDS]
Description = FreeTDS
Driver = /usr/local/Cellar/freetds/0.91/lib/libtdsodbc.so
Setup = /usr/local/Cellar/freetds/0.91/lib/libtdsodbc.so
FileUsage = 1
CPTimeout =
CPResuse =
client charset = utf-8

New examples:

  • filter_grid_on_pageload.phpNote that the filters must be passed as string to data.php via POST, so not possible to use set_grid_property function which takes only array params
$dg->cust_prop_jsonstr = 'postData: {filters:\'{"groupOp":"AND","rules":[{"field":"status","op":"eq","data":"Shipped"}]}\'},';


API change details:

  • enable_edit()
    • Added a 3rd parameter for user defined edit script file name other than the default “edit.php” file. Note that the user defined edit file is NOT automatically passed to detail and subgrid. In most cases, you do not need to use your own edit script rather than simply modify edit.php (requires Enterprise or Universal license for source code).
  • set_col_dynalink
    • now supports local array
  • SQL Server
    • The cells with NULL value repeat the value from the previous row has been fixed due to a bug in ADOdb (server/adodb5/adodb.inc.php), our database abstract class library.
  • before_script_end public variable
    • Added public variable ‘before_script_end’. It can be ‘hooked’ into the display when ALL the DOM elements are ready.
  • priviate cust_prop_jsonstr (known as ud_params pre-version six)
  • set_grid_property()
    • Description: Advanced method. Set custom datagrid properties. The parameter must be an array. You must be rather familiar jqGrid API in order to take advantage of this method effectively. In most cases, you do not need to use this method. Note that this method is not the same as set_grid_method, another advanced phpGrid method.
  •  set_grid_method()
    • It now takes variable arguments. The changes make the function more flexible with different jqGrid methods with variable arguments. Super useful. :)
  • INLINE edit improvement:
    • checkbox now display as checkbox,
    • new blank row when add.
    • auto refresh grid after add.
    • WYSIWYG support
  • set_edit_condition()
    • Set row-level edit condition for edition permission.
  • Composite PK support (Enterprise+)
    • This is a major feature in version 6. Lots of development resources devoted to support composite PK, and yet making it simple at the same time. In stead of passing a single string variable in the constructor as the primary key, you can now pass an array of strings as the composite primary key. For a single primary key, you can still use a string or an array with a single string value. e.g.
  • set_col_edittype
    • Use index number 0 and 1 instead of column name to retrieve data value in “select” edit type. This allows more complex SQL statement such as CONCAT.
  • Conditional format
    • Fixed bug in subgrid due to “+” column
  • set_masterdetail()
    • The `2rd parameter is finally working as intended. It no longer has to be the same name as the master primary key. It was never implemented.
  • New premium themes! (Enterprise+)
    • aristo
    • cobalt
    • retro
  • Global theming support
    • THEME global constant in conf.php to set theme for all the grids. The global theme can be overwriten with set_theme
  • Load error display
    • Added primvate loadError property. The error occurred during load will be displayed.
  • set_sortablerow()
    • Activate sortable row. drag and drop row to sort.
  • toolbar search
    • Changed default value from “equal” to “contain”
  • jqGrid 4.5.2 support
    • Updated with latest jqGrid library
  • Subgrid
    • Now support nested/drill-down subgrid!!
  • FORM & INLINE edit
    • respects edit_options flags
  • Autocomplete support!
  • enable_columnchooser()
  • enable_autoheight()
    • automatically resize based on window width – one step closer to an Excel-like editor.
  • enabled_autoheight()
    • Supported!
  • datepicker
    • Display changeMonth and changeYear dropdown
  • DEBUG globally constant
    • Server error now displays when DEBUG is true in conf.php

Add “PHPGRID” to prefix all DB constant to avoid potential name collisons with other systems and frameworks. eg. WordPress uses DB_NAME variable.