6.9 Archives | phpGrid - PHP Datagrid Create PHP grids in minutes, not hours. Fri, 06 Dec 2024 04:21:03 +0000 en-US hourly 1 CodeProjecthttps://wordpress.org/?v=7.0.3 129966043 Drag and Drop Grouping https://phpgrid.com/example/drag-drop-grouping/ Wed, 15 Jun 2016 12:06:07 +0000 http://phpgrid.com/?p=8985 * Please note this feature is only available in commercial licenses.   You can enable drag & drop a column header to group by that column with a single function call to “enable_dnd_grouping()”. Once it’s enabled, you can drag a column header and drop above the grid where it says “Drop column headers here”. 123456789[cc lang="php"] […]

The post Drag and Drop Grouping appeared first on phpGrid - PHP Datagrid.

]]>
phpgrid_dnd_grouping

* Please note this feature is only available in commercial licenses.

 

You can enable drag & drop a column header to group by that column with a single function call to “enable_dnd_grouping()”. Once it’s enabled, you can drag a column header and drop above the grid where it says “Drop column headers here”.

1
2
3
4
5
6
7
8
9
[cc lang="php"]
// Always include namespace and conf.php on TOP of the script.
use phpCtrl\C_DataGrid;
require_once("/file/path/to/conf.php");  

$dg = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders");
$dg->enable_edit('INLINE');
$dg->enable_dnd_grouping(true);
$dg -> display();

Launch Demo!

The post Drag and Drop Grouping appeared first on phpGrid - PHP Datagrid.

]]>
8985
Persist State of the Sort Order and Page On Page Reload https://phpgrid.com/example/persist-state-current-sort-order-page-page-reload/ Thu, 09 Jun 2016 19:22:49 +0000 http://phpgrid.com/?p=8997 Sometimes you need the datagrid to be able to remember sort order and current page. For that, it requires only a single function call to “enable_persist_state()” function to enable this feature. It stores current page, sort name, sort order, and even filter information in the HTML5 “localStorge” automatically. This is different from Cookie or Session […]

The post Persist State of the Sort Order and Page On Page Reload appeared first on phpGrid - PHP Datagrid.

]]>
Sometimes you need the datagrid to be able to remember sort order and current page. For that, it requires only a single function call to “enable_persist_state()” function to enable this feature. It stores current page, sort name, sort order, and even filter information in the HTML5 “localStorge” automatically. This is different from Cookie or Session because the data stored in localStorage has no expiration time.

When you need to clear what’s int the localStorage for the current datagrid, click the “refresh” icon in the footer.

clear_localstorage

Note it does not support subgrid.

1
2
3
4
5
6
7
8
use phpCtrl\C_DataGrid;
require_once("/file/path/to/conf.php");  

$dg = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders");
$dg->enable_edit('INLINE');
$dg->enable_search(true);
$dg->enable_persist_state(true);
$dg->display();

Launch Demo!

The post Persist State of the Sort Order and Page On Page Reload appeared first on phpGrid - PHP Datagrid.

]]>
8997
Copy Row https://phpgrid.com/example/copy-row/ Sat, 28 May 2016 09:12:48 +0000 http://phpgrid.com/?p=8990   You can now clone a row by simply calling “enable_copyrow()” function. Once it’s enabled, select a row and then in “Copy Row” button in the footer. It will duplicate the selected row in the database table and even return the auto-incremented ID. 123// Always include namespace and conf.php on TOP of the script. use […]

The post Copy Row appeared first on phpGrid - PHP Datagrid.

]]>
phpgrid_copyrow

 

You can now clone a row by simply calling “enable_copyrow()” function. Once it’s enabled, select a row and then in “Copy Row” button in the footer. It will duplicate the selected row in the database table and even return the auto-incremented ID.

1
2
3
// Always include namespace and conf.php on TOP of the script.
use phpCtrl\C_DataGrid;
require_once("/file/path/to/conf.php");

Note that this feature requires the primary key is an auto-increment type.

1
2
3
4
$dg = new C_DataGrid("SELECT `orderNumber`, `orderDate`, `requiredDate`, `shippedDate`, `status`, `comments`, `customerNumber` FROM `orders`", "`orderNumber`", "orders");
$dg -> enable_edit("FORM", "CRUD");
$dg -> enable_copyrow(true);
$dg -> display();

Launch Copy Row Demo!

The post Copy Row appeared first on phpGrid - PHP Datagrid.

]]>
8990